MCPcopy
hub / github.com/baidu/amis / NavPlugin

Class NavPlugin

packages/amis-editor/src/plugin/Nav.tsx:19–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17} from '../renderer/event-control/helper';
18
19export class NavPlugin extends BasePlugin {
20 static id = 'NavPlugin';
21 static scene = ['layout'];
22 // 关联渲染器名字
23 rendererName = 'nav';
24 $schema = '/schemas/NavSchema.json';
25
26 // 组件名称
27 name = '导航';
28 isBaseComponent = true;
29 description = '用来渲染导航菜单,支持横排和竖排。';
30 docLink = '/amis/zh-CN/components/nav';
31 tags = ['功能'];
32 icon = 'fa fa-map-signs';
33 pluginIcon = 'nav-plugin';
34 scaffold = {
35 type: 'nav',
36 stacked: true,
37 popupClassName: 'app-popover :AMISCSSWrapper',
38 links: [
39 {
40 label: '页面1',
41 to: '?id=1',
42 target: '_self',
43 id: '0'
44 },
45 {
46 label: '页面2',
47 to: '?id=2',
48 target: '_self',
49 id: '1'
50 }
51 ]
52 };
53 previewSchema = {
54 ...this.scaffold
55 };
56
57 panelTitle = '导航';
58
59 panelDefinitions = {
60 links: {
61 label: '菜单管理',
62 name: 'links',
63 type: 'combo',
64 multiple: true,
65 draggable: true,
66 addButtonText: '新增菜单',
67 multiLine: true,
68 messages: {
69 validateFailed: '菜单中存在配置错误,请仔细检查'
70 },
71 scaffold: {
72 label: '',
73 to: ''
74 },
75 items: [
76 getSchemaTpl('label', {

Callers

nothing calls this directly

Calls 5

getSchemaTplFunction · 0.90
buildLinkActionDescFunction · 0.90
getActionCommonPropsFunction · 0.90
tipedLabelFunction · 0.90
getEventControlConfigFunction · 0.90

Tested by

no test coverage detected