fix: page menu sort

This commit is contained in:
chenos 2020-12-16 08:43:09 +08:00
parent 866549ce26
commit 50a081c861
2 changed files with 5 additions and 4 deletions

View File

@ -12,7 +12,7 @@ function pages2routes(pages: Array<any>) {
};
// 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<any>) {
...child,
title: child.title,
path: child.path,
order: child.order,
sort: child.sort,
}));
}
if (page.children) {

View File

@ -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',