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

Class List2Plugin

packages/amis-editor/src/plugin/List2.tsx:18–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16import merge from 'lodash/merge';
17
18export class List2Plugin extends BasePlugin {
19 static id = 'List2Plugin';
20 static scene = ['layout'];
21 // 关联渲染器名字
22 rendererName = 'cards';
23 useLazyRender = true; // 使用懒渲染
24 $schema = '/schemas/CardsSchema.json';
25
26 // 组件名称
27 name = '列表';
28 isBaseComponent = true;
29 isListComponent = true;
30 memberImmutable = true;
31 description =
32 '功能类似于表格,但是用一个个小卡片来展示数据。当前组件需要配置数据源,不自带数据拉取,请优先使用 「CRUD」 组件。';
33 docLink = '/amis/zh-CN/components/cards';
34 tags = ['展示'];
35 icon = 'fa fa-window-maximize';
36 pluginIcon = 'cards-plugin';
37 scaffold = {
38 type: 'cards',
39 card: {
40 type: 'container',
41 body: [
42 {
43 type: 'container',
44 body: [
45 {
46 type: 'tpl',
47 tpl: '01',
48 inline: true,
49 wrapperComponent: '',
50 style: {},
51 themeCss: {
52 baseControlClassName: {
53 'padding-and-margin:default': {
54 marginRight: '10px'
55 },
56 'font:default': {
57 color: 'var(--colors-neutral-text-2)',
58 fontSize: 'var(--fonts-size-3)',
59 fontWeight: 'var(--fonts-weight-5)'
60 }
61 }
62 },
63 id: generateId()
64 },
65 {
66 type: 'tpl',
67 tpl: '/',
68 inline: true,
69 wrapperComponent: '',
70 style: {},
71 id: generateId(),
72 themeCss: {
73 baseControlClassName: {
74 'padding-and-margin:default': {
75 marginRight: '10px'

Callers

nothing calls this directly

Calls 4

generateIdFunction · 0.90
getI18nEnabledFunction · 0.90
getSchemaTplFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected