abstrakt:配置路徑的作用就是指定小程序由哪些頁面組成,每一項(xiàng)都對(duì)應(yīng)一個(gè)頁面的路徑+文件名信息,文件名不需要寫文件后綴,框架會(huì)自動(dòng)去尋找對(duì)于位置的 .json, .js, .wxml, .wxss 四個(gè)文件進(jìn)行處理;通過配置根目錄下的app.json的pages屬性來配置。底部按鈕配置就是配置小程序客戶端窗口的底部或頂部有 tab 欄可以切換頁面,可以通過根目錄下的app.json文件的tabBar配置項(xiàng)指定
配置路徑的作用就是指定小程序由哪些頁面組成,每一項(xiàng)都對(duì)應(yīng)一個(gè)頁面的路徑+文件名信息,文件名不需要寫文件后綴,框架會(huì)自動(dòng)去尋找對(duì)于位置的 .json, .js, .wxml, .wxss 四個(gè)文件進(jìn)行處理;通過配置根目錄下的app.json的pages屬性來配置。
底部按鈕配置就是配置小程序客戶端窗口的底部或頂部有 tab 欄可以切換頁面,可以通過根目錄下的app.json文件的tabBar配置項(xiàng)指定tab欄的表現(xiàn),以及tab切換時(shí)顯示的對(duì)應(yīng)頁面,tab欄按鈕最少是2個(gè)最多是5個(gè)。
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" } ] } }
Korrigierender Lehrer:查無此人Korrekturzeit:2018-12-27 09:29:16
Zusammenfassung des Lehrers:總結(jié)的不錯(cuò),小程序配置比其他的語言簡(jiǎn)單,加油,好好學(xué)。