【个人笔记】小程序UI框架ColorUI,学习笔记
发布于 4 年前 作者 dengqiang 3604 次浏览 来自 分享

这几天接触一个开源小程序项目,UI是用ColorUI,惊艳于这个框架,确实非常nice

小程序示例看着很美,不知道怎么用,限于该UI框架是个人维护,目前没有自己的官网和上手指引文档,今天找了份文档,具体见

git主页,多半不是那么容易打开的,你懂得

https://github.com/weilanwl/ColorUI/

CSDN上找了 份上手示例,可以参考下

小程序colorUI框架初步使用教程

https://blog.csdn.net/IT_TIfarmer/article/details/88380308

ColorUI语雀文档

https://www.yuque.com/r/colorui/books?q=

鲜亮的高饱和色彩,专注视觉的小程序组件库

GitHub 地址:https://github.com/weilanwl/ColorUI

开发文档参考(编辑中):https://www.color-ui.co

使用心得:

1、优点:视觉效果漂亮,注意看一下,他可以将样式沉浸到手机最顶部,这一点很好,同时其他组件也挺好,可针对自己的需求,直接修改或覆盖他的css样式。

2、缺点:缺少文档、很多新人无从下手。扫码预览时,近期广告有些频繁,影响使用,开发者也想有点费用,大家理解,喜欢的可以对开发者点广告支持,开源不易。



以下内容摘录自git页

GitHub 地址:https://github.com/weilanwl/ColorUI

使用原生小程序开发


从现有项目开始

下载源码解压获得/demo,复制目录下的 /colorui 文件夹到你的项目根目录

App.wxss 引入关键Css main.wxss icon.wxss

[@import](/user/import) "colorui/main.wxss";
[@import](/user/import) "colorui/icon.wxss";
[@import](/user/import) "app.css"; /* 你的项目css */
....


从新项目开始

下载源码解压获得/template,复制/template并重命名为你的项目,导入到小程序开发工具既可以开始你的新项目了


使用自定义导航栏

导航栏作为常用组件有做简单封装,当然你也可以直接复制代码结构自己修改,达到个性化目的。

App.js 获得系统信息

 onLaunch: function() {
    wx.getSystemInfo({
      success: e => {
        this.globalData.StatusBar = e.statusBarHeight;
        let custom = wx.getMenuButtonBoundingClientRect();
        this.globalData.Custom = custom;  
        this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
      }
    })
},

App.json 配置取消系统导航栏,并全局引入组件

"window": {
	"navigationStyle": "custom"
},
"usingComponents": {
    "cu-custom":"/colorui/components/cu-custom"
}

page.wxml 页面可以直接调用了

<cu-custom bgColor="bg-gradual-pink" isBack="{{true}}">
	<view slot="backText">返回</view>
	<view slot="content">导航栏</view>
</cu-custom>



2 回复

能QQ或微信分享一下下载文件吗,打不开git

高产啊 ,一天一篇啊

回到顶部