uniapp subPackages 分包及页面路由跳转

https://uniapp.dcloud.net.cn/collocation/pages.html#subpackages

uniapp subPackages 分包及页面路由跳转_第1张图片

uniapp subPackages 分包及页面路由跳转_第2张图片

pages.json:

{
  "pages": [
    {
      "path": "pages/index/index",
      "style": {
        "navigationBarTitleText": "uni-app",
        "navigationStyle": "custom"
      }
    }
  ],
  "subPackages": [
    {
      "root": "pages/light",
      "pages": [
        {
          "path": "index/index",
          "style": {
            "navigationBarTitleText": "首页"
          }
        }
      ]
    }
  ],
  "globalStyle": {
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "uni-app",
    "navigationBarBackgroundColor": "#F8F8F8",
    "backgroundColor": "#F8F8F8"
  }
}

pages/index/index.vue:






pages/index/index.css:

.m-login-wrap{display: flex;padding: 10px;}
.m-login-btn{width: 100px;margin: 0;}



pages/light/index/index.vue:



配置分包文件后需要重启项目

https://uniapp.dcloud.net.cn/api/router.html#navigateto

uniapp subPackages 分包及页面路由跳转_第3张图片

uniapp subPackages 分包及页面路由跳转_第4张图片

人工智能学习网站

https://chat.xutongbao.top

你可能感兴趣的:(前端技术分享,uni-app)