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

Class CollapsePlugin

packages/amis-editor/src/plugin/Collapse.tsx:22–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20import {generateId} from '../util';
21
22export class CollapsePlugin extends BasePlugin {
23 static id = 'CollapsePlugin';
24 // 关联渲染器名字
25 rendererName = 'collapse';
26 useLazyRender = true; // 使用懒渲染
27 $schema = '/schemas/CollapseSchema.json';
28
29 // 组件名称
30 name = '折叠器';
31 isBaseComponent = true;
32 description = '折叠器,可以将内容区展开或隐藏,保持页面的整洁';
33 docLink = '/amis/zh-CN/components/collapse';
34 tags = ['展示'];
35 icon = 'fa fa-window-minimize';
36 pluginIcon = 'collapse-plugin';
37 scaffold = {
38 type: 'collapse',
39 header: '标题',
40 body: [
41 {
42 type: 'tpl',
43 tpl: '内容',
44 wrapperComponent: '',
45 inline: false,
46 id: generateId()
47 }
48 ]
49 };
50 previewSchema = {
51 ...this.scaffold
52 };
53 panelTitle = '折叠器';
54
55 panelJustify = true;
56
57 events: RendererPluginEvent[] = [
58 {
59 eventName: 'change',
60 eventLabel: '折叠状态改变',
61 description: '折叠器折叠状态改变时触发',
62 dataSchema: [
63 {
64 type: 'object',
65 properties: {
66 data: {
67 type: 'object',
68 title: '数据',
69 properties: {
70 collapsed: {
71 type: 'boolean',
72 title: '折叠器状态'
73 }
74 }
75 }
76 }
77 }
78 ]
79 },

Callers

nothing calls this directly

Calls 7

generateIdFunction · 0.90
buildLinkActionDescFunction · 0.90
getActionCommonPropsFunction · 0.90
getI18nEnabledFunction · 0.90
getSchemaTplFunction · 0.90
defaultValueFunction · 0.90
getEventControlConfigFunction · 0.90

Tested by

no test coverage detected