amis
amis copied to clipboard
App模式下路由问题
实现场景:
实现一个app多页应用
存在的问题:
App模式下,路由跳转的时候总是提示找不到文件

当前方案:
部分代码粘贴,加载到 "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"
},
......
需要重写jumpTo来达到使用hash路由 具体可以参考https://github.com/aisuda/amis-admin https://github.com/aisuda/amis-admin/blob/9f4fc730c078e5259162b615403b38e8b895e898/index.html#L151-L183
有没有React项目的例子