赞
踩
"subPackages": [
{
"root": "subpackage/",
"pages": [
"pages/testFun1/testFun1",
"pages/testFun2/testFun2",
"pages/testFun3/testFun3"
]
}
]
<van-cell-group>
<van-cell wx:for="{{JumpObj}}" wx:key="{{index}}" title="{{item.title}}" catchtap="{{item.func}}" is-link />
</van-cell-group>
// pages/info/info.js Page({ /** * 页面的初始数据 */ data: { // 跳转 页面的数据 JumpObj:[ { title:"测试1", func:"testFun1" }, { title:"测试2", func:"testFun2" }, { title:"测试3", func:"testFun3" }, ] }, // 跳转 测试相关 testFun1(){ console.log("testFun1"); wx.navigateTo({ url: '../../subpackage/pages/testFun1/testFun1', }) }, testFun2(){ wx.navigateTo({ url: '../../subpackage/pages/testFun2/testFun2', }) }, testFun3(){ wx.navigateTo({ url: '../../subpackage/pages/testFun3/testFun3', }) }, })
"subPackages": [ { "root": "subpackage/", "pages": [ "pages/testFun1/testFun1" ] }, { "root": "subpackage2/", "name":"pack1", "pages": [ "pages/testFun2/testFun2" ] } ]
"subPackages": [ { "root": "subpackage/", "pages": [ "pages/testFun1/testFun1" ] }, { "root": "subpackage2/", "name":"pack1", "pages": [ "pages/testFun2/testFun2" ], "independent": true } ]
{ "pages": [ "pages/index/index", "pages/info/info", "pages/about/about", "pages/mine/mine" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "Weixin", "navigationBarTextStyle":"black" }, "sitemapLocation": "sitemap.json", "usingComponents": { "van-button": "@vant/weapp/button/index" }, "tabBar": { "selectedColor": "#576b95", "color": "#888888", "borderStyle": "white", "list": [ { "pagePath": "pages/index/index", "text": "首页", "iconPath": "static/tabImg/index.png", "selectedIconPath": "static/tabImg/indexSelect.png" }, { "pagePath": "pages/info/info", "text": "信息", "iconPath": "static/tabImg/index.png", "selectedIconPath": "static/tabImg/indexSelect.png" }, { "pagePath": "pages/about/about", "text": "关于", "iconPath": "static/tabImg/geren.png", "selectedIconPath": "static/tabImg/gerenSelect.png" }, { "pagePath": "pages/mine/mine", "text": "我的", "iconPath": "static/tabImg/geren.png", "selectedIconPath": "static/tabImg/gerenSelect.png" } ] }, "subPackages": [ { "root": "subpackage/", "pages": [ "pages/testFun1/testFun1" ] }, { "root": "subpackage2/", "name":"pack1", "pages": [ "pages/testFun2/testFun2" ], "independent": true } ], // 分包预下载 "preloadRule": { "pages/info/info":{ // 进入的那个页面 info页面 下载 subpackage2包 网络状态 wifi 或者 all "packages": ["subpackage2"], "network":"wifi" } } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。