小程序设置页面背景颜色

版权声明:转载请评论留言 https://blog.csdn.net/solocao/article/details/85721007

首先,我使用的是mpvue开发。样式使用的less,并且全局会定义一套主题。

@primary-color         : #ff8730;
@second-color          : #F48B4A;
@background-color      :#F3F3F3;
@second-text-color     :#787878;

.flex-center-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.flex-center-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
<style lang="less">
  @import "../../theme/orange.less";
  page {
    background-color: @background-color;
  }
</style>

页面效果如下
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/solocao/article/details/85721007