前言:本文是學習網易微專業的《python全棧工程師 - Django快速建站》課程的筆記,歡迎學習交流。同時感謝老師們的精彩傳授!
一、課程目标
- 使用
元件weUI
- 建立
tabBar
- 更多常見應用開發
二、詳情解讀
2.1. weUI
元件
weUI
2.1.1.介紹
-
元件是一套基于樣式庫weUI
開發的小程式擴充weui-wxss
UI
元件庫
– 同微信原生視覺體驗一緻的元件庫
– 由微信官方設計團隊和小程式團隊為微信小程式量身設計
– 使用者的使用感覺更加統一
2.1.2.安裝元件庫
-
安裝
– 進入到小程式項目要目錄
– 安裝
,解決cnpm
安裝源問題:npm
npm install -g cnpm -registry=https://registry.npm.taobao.org
- 安裝
元件weUI
cnpm install weui-miniprogram -S
-S
:表示生成
package.json
檔案
2.1.3.使用元件庫
- 在
中引入安裝的元件庫app.wxss
2.2.建立 tabBar
tabBar
2.2.1.建立流程
- 在
中添加:app.json
"tabBar": {...}
"tabBar": {
"color": "black",
"position": "bottom",
"list": [
{
"pagePath": "pages/index/index",
"text": "首頁",
"iconPath": "images/index.png",
"selectedIconPath": "images/indexed.png"
},
{
"pagePath": "pages/books/books",
"text": "書籍",
"iconPath": "images/book.png",
"selectedIconPath": "images/booked.png"
},
{
"pagePath": "pages/location/location",
"text": "位置",
"iconPath": "images/location.png",
"selectedIconPath": "images/locationed.png"
},
]
}
更多圖示,請參考官網:https://www.iconfont.cn
本節微信小程式源碼,請參考分享資源裡的專題一
連結:https://pan.baidu.com/s/1FfgbrIw0VwtUDJ-ZVUiALA
提取碼:d7ke
三、課程小結
- 01 使用元件庫
- 02 建立
tabBar
- -03 開發其他功能