日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

colorui开发文档_小程序原生高颜值组件库--ColorUI

發(fā)布時(shí)間:2023/12/9 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 colorui开发文档_小程序原生高颜值组件库--ColorUI 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

開源推薦!注重視覺交互的高顏值第三方組件庫--ColorUI組件庫。


簡(jiǎn)介
ColorUI是一個(gè)Css類的UI組件庫!不是一個(gè)Js框架。相比于同類小程序組件庫,ColorUI更注重于視覺交互!
瀏覽GitHub:https://github.com/weilanwl/ColorUI


如何使用?
先下載源碼包
→ Github
引入到我的小程序
將 /demo/ 下的 colorui.wxss 和 icon.wxss 復(fù)制到小程序的根目錄下
在 app.wxss 引入兩個(gè)文件

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


使用模板全新開發(fā)
復(fù)制 /template/ 文件夾并重命名為你的項(xiàng)目,微信開發(fā)者工具導(dǎo)入為小程序就可以使用ColorUI了
體驗(yàn)沉浸式導(dǎo)航

//App.js App({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.js
獲取系統(tǒng)參數(shù)并寫入全局參數(shù)。

//App.js App({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;}})} })

Page.js
頁面配置獲取全局參數(shù)。

//Page.js const app = getApp() Page({data: {StatusBar: app.globalData.StatusBar,CustomBar: app.globalData.CustomBar,Custom: app.globalData.Custom} })

Page.wxml
頁面構(gòu)造導(dǎo)航。更多導(dǎo)航樣式請(qǐng)下載Demo查閱 操作條組件。

<view class="cu-custom" style="height:{{CustomBar}}px;"><view class="cu-bar fixed bg-gradual-pink" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;"><navigator class='action border-custom' open-type="navigateBack" delta="1" hover-class="none" style='width:{{Custom.width}}px;height:{{Custom.height}}px;margin-left:calc(750rpx - {{Custom.right}}px)'><text class='icon-back'></text><text class='icon-homefill'></text></navigator><view class='content' style='top:{{StatusBar}}px;'>操作條</view></view> </view>

自定義系統(tǒng)Tabbar

按照官方 自定義 tabBar 配置好Tabbar (開發(fā)工具和版本庫請(qǐng)使用最新版)。

使用ColorUI配置Tabbar只需要更改 Wxml 頁的內(nèi)容即可。
更多Tabbar樣式請(qǐng)下載Demo查閱 操作條組件。

/custom-tab-bar/index.wxml

<view class="cu-bar tabbar bg-white shadow"><view class="action" wx:for="{{list}}" wx:key="index" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab"><view class='icon-cu-image'><image src='{{selected === index ? item.selectedIconPath : item.iconPath}}' class='{{selected === index ? "animation" : "animation"}}'></image></view><view class='{{selected === index ? "text-green" : "text-gray"}}'>{{item.text}}</view></view> </view>

作者叨叨

ColorUI是一個(gè)高度自定義的Css樣式庫,包含了開發(fā)常用的元素和組件,元素組件之間也能相互嵌套使用。我也會(huì)不定期更新一些擴(kuò)展到源碼。

其實(shí)大家都在催我寫文檔,但這個(gè)庫源碼就在這,所見即所得,粘貼復(fù)制就可以得到你想要的頁面。當(dāng)然,文檔我還是要寫的,也希望大家多多提意見。

現(xiàn)在前端的開發(fā)方向基本都是奔著Js方向的,布局和樣式大家討論的有點(diǎn)少。以后我會(huì)在開發(fā)者社區(qū)多聊一聊關(guān)于開發(fā)中的布局和樣式。

總結(jié)

以上是生活随笔為你收集整理的colorui开发文档_小程序原生高颜值组件库--ColorUI的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。