mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:55:50 +00:00
fix: page menu sort
This commit is contained in:
parent
866549ce26
commit
50a081c861
@ -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) {
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user