amis icon indicating copy to clipboard operation
amis copied to clipboard

App模式下路由问题

Open manguanghui opened this issue 5 years ago • 2 comments

实现场景:

实现一个app多页应用

存在的问题:

App模式下,路由跳转的时候总是提示找不到文件 image

当前方案:

部分代码粘贴,加载到 "schemaApi": "get:/pages/crud-admin-list.json"时,就提示找不到文件

let amisJSON = {
        type: 'app',
        brandName: 'Admin',
        logo: 'public/logo.png',
        header: {
          type: 'tpl',
          inline: false,
          className: 'w-full',
          tpl: '<div class="flex justify-between"><div>顶部区域左侧</div><div>顶部区域右侧</div></div>'
        },
        "pages": [
          {
            "label": "管理员",
            "children": [
              {
                "label": "管理员列表",
                "name": "admin",
                "url": "/admin",
                "rewrite": "/admin/list",
                "icon": "fa fa-cube",
                "children": [
                  {
                    "label": "列表",
                    "url": "/admin/list",
                    "icon": "fa fa-list",
                    "schemaApi": "get:/pages/crud-admin-list.json"
                  },
......

manguanghui avatar Jul 20 '21 07:07 manguanghui

需要重写jumpTo来达到使用hash路由 具体可以参考https://github.com/aisuda/amis-admin https://github.com/aisuda/amis-admin/blob/9f4fc730c078e5259162b615403b38e8b895e898/index.html#L151-L183

502647092 avatar Jul 20 '21 07:07 502647092

有没有React项目的例子

user-huage avatar Sep 14 '21 08:09 user-huage