diff --git a/packages/plugin-pages/src/actions/getRoutes.ts b/packages/plugin-pages/src/actions/getRoutes.ts index 21be91a216..8b9bbdc611 100644 --- a/packages/plugin-pages/src/actions/getRoutes.ts +++ b/packages/plugin-pages/src/actions/getRoutes.ts @@ -12,7 +12,7 @@ function pages2routes(pages: Array) { }; // page.type === 'layout' && if (!page.redirect && children.length) { - const items = children.sort((a, b) => a.order - b.order); + const items = children.sort((a, b) => a.sort - b.sort); route.redirect = items[0].path; } if (page.type === 'layout' && children.length) { @@ -20,7 +20,7 @@ function pages2routes(pages: Array) { ...child, title: child.title, path: child.path, - order: child.order, + sort: child.sort, })); } if (page.children) { diff --git a/packages/plugin-pages/src/collections/pages.ts b/packages/plugin-pages/src/collections/pages.ts index 5889776180..1b383167b5 100644 --- a/packages/plugin-pages/src/collections/pages.ts +++ b/packages/plugin-pages/src/collections/pages.ts @@ -3,14 +3,15 @@ import { TableOptions } from '@nocobase/database'; export default { name: 'pages', title: '页面配置', - model: 'BaseModel', + model: 'PageModel', internal: true, developerMode: true, fields: [ { interface: 'sort', - type: 'integer', + type: 'sort', name: 'sort', + scope: ['parent_id'], title: '排序', component: { type: 'sort',