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