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

Class AnchorNavPlugin

packages/amis-editor/src/plugin/AnchorNav.tsx:14–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12registerFilter('appTranslate', (input: any) => translateSchema(input));
13
14export class AnchorNavPlugin extends BasePlugin {
15 static id = 'AnchorNavPlugin';
16 // 关联渲染器名字
17 rendererName = 'anchor-nav';
18 $schema = '/schemas/AnchorNavSchema.json';
19
20 // 组件名称
21 name = '锚点导航';
22 isBaseComponent = true;
23 description =
24 '锚点导航,在多行内容展示时,可以将内容用锚点导航分组的形式展示,点击导航菜单可以定位到对应内容区域。';
25 docLink = '/amis/zh-CN/components/anchor-nav';
26 tags = ['功能'];
27 icon = 'fa fa-link';
28 pluginIcon = 'anchor-nav-plugin';
29 scaffold = {
30 type: 'anchor-nav',
31 links: [
32 {
33 title: '锚点1',
34 href: '1',
35 body: [
36 {
37 type: 'tpl',
38 tpl: '这里是锚点内容1',
39 wrapperComponent: '',
40 inline: false,
41 id: generateId()
42 }
43 ]
44 },
45 {
46 title: '锚点2',
47 href: '2',
48 body: [
49 {
50 type: 'tpl',
51 tpl: '这里是锚点内容2',
52 wrapperComponent: '',
53 inline: false,
54 id: generateId()
55 }
56 ]
57 },
58 {
59 title: '锚点3',
60 href: '3',
61 body: [
62 {
63 type: 'tpl',
64 tpl: '这里是锚点内容3',
65 wrapperComponent: '',
66 inline: false,
67 id: generateId()
68 }
69 ]
70 }
71 ]

Callers

nothing calls this directly

Calls 5

generateIdFunction · 0.90
getSchemaTplFunction · 0.90
insertRegionFunction · 0.85
setValuesMethod · 0.80
forEachMethod · 0.80

Tested by

no test coverage detected