abstrait:配置路徑的作用就是指定小程序由哪些頁面組成,每一項都對應(yīng)一個頁面的路徑+文件名信息,文件名不需要寫文件后綴,框架會自動去尋找對于位置的 .json, .js, .wxml, .wxss 四個文件進行處理;通過配置根目錄下的app.json的pages屬性來配置。底部按鈕配置就是配置小程序客戶端窗口的底部或頂部有 tab 欄可以切換頁面,可以通過根目錄下的app.json文件的tabBar配置項指定
配置路徑的作用就是指定小程序由哪些頁面組成,每一項都對應(yīng)一個頁面的路徑+文件名信息,文件名不需要寫文件后綴,框架會自動去尋找對于位置的 .json, .js, .wxml, .wxss 四個文件進行處理;通過配置根目錄下的app.json的pages屬性來配置。
底部按鈕配置就是配置小程序客戶端窗口的底部或頂部有 tab 欄可以切換頁面,可以通過根目錄下的app.json文件的tabBar配置項指定tab欄的表現(xiàn),以及tab切換時顯示的對應(yīng)頁面,tab欄按鈕最少是2個最多是5個。
app.json配置文件代碼
{ "pages":[ "pages/index/index", "pages/goods/index", "pages/goods/list", "pages/goods/details", "pages/shop/list", "pages/shop/order", "pages/my/index", "pages/my/order", "pages/my/details" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#708090", "navigationBarTitleText": "微商城", "navigationBarTextStyle":"#fff" }, "tabBar": { "list": [{ "pagePath": "pages/index/index", "text": "首頁", "iconPath": "img/index.png", "selectedIconPath": "img/indexs.png" }, { "pagePath": "pages/goods/index", "text": "商品", "iconPath": "img/goods.png", "selectedIconPath": "img/goodss.png" }, { "pagePath": "pages/shop/list", "text": "購物車", "iconPath": "img/shop.png", "selectedIconPath": "img/shops.png" }, { "pagePath": "pages/my/index", "text": "我的", "iconPath": "img/my.png", "selectedIconPath": "img/mys.png" } ] } }
Professeur correcteur:查無此人Temps de correction:2018-12-27 09:29:16
Résumé du professeur:總結(jié)的不錯,小程序配置比其他的語言簡單,加油,好好學(xué)。