微信小程序之官方UI框架 iView UI的使用
一、搭環境
官網:https://weapp.iviewui.com/docs/guide/start
1、到 GitHub 下載 iView Weapp 的代碼,將 dist 目錄拷貝到自己的項目中。然后按照如下的方式使用組件,以 Button 為例,其它組件在對應的文檔頁查看:
① 添加需要的組件。在頁面的 json 中配置(路徑根據自己項目位置配置):
"usingComponents": {
"i-button": "../../dist/button/index"}
② 在 wxml 中使用組件:
<i-button type="primary" bind:click="handleClick">這是一個按鈕</i-button>
2、或按以下方式在微信開發者工具中查看:
# 從 GitHub 下載后,安裝依賴npm install
# 編譯組件npm run dev
然后,將 examples 目錄在微信開發者工具中打開即可。
3、分包加載
https://developers.weixin.qq.com/miniprogram/dev/framework/subpackages/basic.html