微信小程序+ColorUI

官网

1、

2、

3、

开发

1、下载官方案例demo,文件如下,colorui是独立的引入文件夹资源。

2、在app.json内

3、配置引入css样式的操作、pages和colorui同级目录

4、app.json

{
          
   
  "pages": [
    "pages/index/index"
  ],
  "window": {
          
   
    "navigationBarBackgroundColor": "#39b54a",
    "navigationBarTitleText": "Color UI",
    "navigationStyle": "custom",
    "navigationBarTextStyle": "white"
  },
  "usingComponents": {
          
   
    "cu-custom": "/colorui/components/cu-custom"
  },
  "sitemapLocation": "sitemap.json"
}

5、app.wxss

@import "colorui/main.wxss";
@import "colorui/icon.wxss";

6、页面的wxml、大功告成

<cu-custom bgColor="bg-gradual-blue" isBack="{
           
    {true}}">
  <view slot="backText">返回</view>
  <view slot="content">布局</view>
</cu-custom>

如何使用

根据demo里面现成的页面,可以直接复制,然后改成自己的页面,其他的页面同样如此。

经验分享 程序员 微信小程序 职场和发展