lcap-frontend-library 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +271 -0
- package/bin/lcap-frontend-library.mjs +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +27 -0
- package/dist/init.d.ts +6 -0
- package/dist/init.js +79 -0
- package/dist/sync.d.ts +4 -0
- package/dist/sync.js +70 -0
- package/dist/utils.d.ts +19 -0
- package/dist/utils.js +101 -0
- package/package.json +34 -0
- package/packages/lcap-frontend-library/LEARNINGS.md +11 -0
- package/packages/lcap-frontend-library/SKILL.md +86 -0
- package/packages/lcap-frontend-library/commands/migrate.check.md +287 -0
- package/packages/lcap-frontend-library/commands/migrate.green.md +190 -0
- package/packages/lcap-frontend-library/commands/migrate.plan.md +169 -0
- package/packages/lcap-frontend-library/commands/migrate.red.md +160 -0
- package/packages/lcap-frontend-library/commands/migrate.scan.md +151 -0
- package/packages/lcap-frontend-library/commands/migrate.spec.md +144 -0
- package/packages/lcap-frontend-library/commands/migrate.tasks.md +179 -0
- package/packages/lcap-frontend-library/commands/speckit.create.md +201 -0
- package/packages/lcap-frontend-library/commands/speckit.implement.md +88 -0
- package/packages/lcap-frontend-library/commands/speckit.plan.md +79 -0
- package/packages/lcap-frontend-library/commands/speckit.self-check.md +177 -0
- package/packages/lcap-frontend-library/commands/speckit.specify.md +91 -0
- package/packages/lcap-frontend-library/commands/speckit.tasks.md +61 -0
- package/packages/lcap-frontend-library/references/frontend-design/LICENSE.txt +177 -0
- package/packages/lcap-frontend-library/references/frontend-design/SKILL.md +42 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/SKILL.md +360 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/api.md +331 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/block.md +160 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/i18n.md +95 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/icon.md +27 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide/container.md +728 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide/element.md +312 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide/expression.md +154 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide/index.md +113 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide/modal.md +189 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide/popover.md +171 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/ide.md +799 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/implementation-rules.md +242 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/index.md +27 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/nasl-view-component.md +895 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/accessibility.md +185 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/child.md +82 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/data-source.md +261 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/event.md +171 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/form.md +266 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/function.md +80 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/link.md +137 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/slot.md +128 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/theme-variables-ant-design.md +1470 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/theme-variables-cloud-ui.md +259 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/theme-variables-element-plus.md +580 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/theme-variables-element-ui.md +1007 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/platform/theme-variables-mobile-ui.md +85 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/theme.md +234 -0
- package/packages/lcap-frontend-library/references/lcap-extension-component/workflow-guardrails.md +328 -0
- package/packages/lcap-frontend-library/references/nasl-logic-authoring/SKILL.md +201 -0
- package/packages/lcap-frontend-library/scripts/bash/create-component-files.sh +95 -0
- package/packages/lcap-frontend-library/scripts/bash/create-extension-project.sh +109 -0
- package/packages/lcap-frontend-library/scripts/bash/create-logic-files.sh +149 -0
- package/packages/lcap-frontend-library/scripts/bash/create-spec.sh +109 -0
- package/packages/lcap-frontend-library/scripts/bash/get-available-port.sh +35 -0
- package/packages/lcap-frontend-library/scripts/bash/list-specs.sh +19 -0
- package/packages/lcap-frontend-library/scripts/node/setup-extension-project.mjs +166 -0
- package/packages/lcap-frontend-library/templates/component-self-check.md +31 -0
- package/packages/lcap-frontend-library/templates/component-template.md +96 -0
- package/packages/lcap-frontend-library/templates/library-report-template.md +52 -0
- package/packages/lcap-frontend-library/templates/logic-template.md +44 -0
- package/packages/lcap-frontend-library/templates/migration-manifest-template.md +84 -0
- package/packages/lcap-frontend-library/templates/migration-plan-template.md +138 -0
- package/packages/lcap-frontend-library/templates/migration-report-template.md +227 -0
- package/packages/lcap-frontend-library/templates/migration-spec-template.md +135 -0
- package/packages/lcap-frontend-library/templates/migration-tasks-template.md +129 -0
- package/packages/lcap-frontend-library/templates/plan-template.md +299 -0
- package/packages/lcap-frontend-library/templates/self-check-report-template.md +148 -0
- package/packages/lcap-frontend-library/templates/tasks-template.md +81 -0
- package/packages/lcap-frontend-library/workflows/create/flow.md +199 -0
- package/packages/lcap-frontend-library/workflows/evolve/flow.md +249 -0
- package/packages/lcap-frontend-library/workflows/generate/flow.md +10 -0
- package/packages/lcap-frontend-library/workflows/harness/flow.md +82 -0
- package/packages/lcap-frontend-library/workflows/migrate/flow.md +302 -0
- package/packages/lcap-frontend-library/workflows/migrate/knowledge-base.md +564 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# modal | drawer | messager 配置说明
|
|
6
|
+
|
|
7
|
+
类型为 "modal"、 "drawer"、 "messager" 的组件分别对应了弹窗、抽屉、弹出消息三种组件:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
@ExtensionComponent({
|
|
11
|
+
ideusage: {
|
|
12
|
+
"idetype": "modal" //或"drawer" 或"messager"
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<div class="highlight">
|
|
20
|
+
|
|
21
|
+
可以在设计器内,通过双击打开组件弹窗,通过关闭按钮关闭当前弹窗。
|
|
22
|
+
|
|
23
|
+
弹窗类组件必须配置 selector,用于选中弹窗组件本身,否则将出现无法拖入组件,关闭按钮出不来的问题。
|
|
24
|
+
|
|
25
|
+
另外还需要设置 cacheOpenKey,用于向弹窗组件传递开关状态,值为属性名称。
|
|
26
|
+
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
下文以 vue 模板为例,展示配置和翻译器生层代码的匹配关系。React 相似。
|
|
31
|
+
|
|
32
|
+
## 示例
|
|
33
|
+
|
|
34
|
+
以 CloudUI 的弹窗为例:
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
@ExtensionComponent({
|
|
38
|
+
"ideusage": {
|
|
39
|
+
"idetype": "modal",
|
|
40
|
+
"selector": {
|
|
41
|
+
"expression": "this.getElement(el => el.slotTarget === 'body')",
|
|
42
|
+
"cssSelector": "div[class^='u-modal_dialog']"
|
|
43
|
+
},
|
|
44
|
+
"cacheOpenKey": "visible",
|
|
45
|
+
...
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
这段配置会生成如下模板代码:
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<u-modal key="component-0318bd77736b4ec48ac739ec78ff55ba" :visible="true">
|
|
54
|
+
<template slot="title">
|
|
55
|
+
<div data-nodepath="734cd0e5ed8943f8b24493a2b04cd7f6">
|
|
56
|
+
<EmptySlot data-emptyslot-nodepath="734cd0e5ed8943f8b24493a2b04cd7f6"></EmptySlot>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
<template slot="body">
|
|
60
|
+
<HoistNodePath nodePath="0318bd77736b4ec48ac739ec78ff55ba" topSelector="div[class^='u-modal_dialog']">
|
|
61
|
+
</HoistNodePath>
|
|
62
|
+
<div data-nodepath="ec5a186379744599a5d5ecfcf5322fb4">
|
|
63
|
+
<EmptySlot data-emptyslot-nodepath="ec5a186379744599a5d5ecfcf5322fb4"></EmptySlot>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
<template slot="foot">
|
|
67
|
+
<div data-nodepath="c3b7f6018e9746db9c6bd4dfef063a71">
|
|
68
|
+
<EmptySlot data-emptyslot-nodepath="c3b7f6018e9746db9c6bd4dfef063a71"></EmptySlot>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
<template slot="heading">
|
|
72
|
+
<div data-nodepath="b08d6c6b2552461eac38cfdf037e49a0">
|
|
73
|
+
<EmptySlot data-emptyslot-nodepath="b08d6c6b2552461eac38cfdf037e49a0"></EmptySlot>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
<EmptySlot data-emptyslot-nodepath="0318bd77736b4ec48ac739ec78ff55ba"></EmptySlot>
|
|
77
|
+
</u-modal>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
<div class="highlight">
|
|
81
|
+
|
|
82
|
+
HoistNodePath 从 body slot 内,向上注入data-\*属性到能匹配 div\[class^='u-modal\_dialog'] 的dom元素上。
|
|
83
|
+
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## 配置项说明
|
|
88
|
+
|
|
89
|
+
### cacheOpenKey
|
|
90
|
+
|
|
91
|
+
 必配,定义控制弹窗显隐的属性。书写格式为`"cacheOpenKey": "控制弹窗显隐的属性名"`,例如:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
"cacheOpenKey": "visible"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
此处 cacheOpenKey 定义的是弹窗的“显示状态”属性,属性描述如下:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
@Prop({
|
|
101
|
+
title: '显示状态'
|
|
102
|
+
})
|
|
103
|
+
visible: nasl.core.Boolean;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### parentAccept
|
|
107
|
+
|
|
108
|
+
选配,定义可以放入当前组件的父组件。书写格式为`"parentAccept":"判断表达式"`,例如要求组件只能置入到面包屑组件 u-crumb 中:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
"parentAccept": "target.tag === 'u-crumb'"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### childAccept
|
|
115
|
+
|
|
116
|
+
选配,定义可以放入子组件的组件。书写格式为`"parentAccept":"判断表达式"`或`"parentAccept":Object`。
|
|
117
|
+
|
|
118
|
+
- 表达式形式:
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
"childAccept": "target.tag === 'Radio'",
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- 对象形式:key为slot中配置的名字,value是表达式
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
"childAccept": {
|
|
128
|
+
"default": "this.getDefaultElements().length < 1",
|
|
129
|
+
"menuItem": "target.tag === 'MenuItem'"
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### selector
|
|
134
|
+
|
|
135
|
+
选配,若存在无法将data-nodepath 传入顶层DOM节点,可以通过设置此项绕行,绕行是通过向具体组件内部放入一个能够根据css选择器向上查找DOM节点的组件X。书写格式为:
|
|
136
|
+
|
|
137
|
+
"selector": [
|
|
138
|
+
{
|
|
139
|
+
"expression": String,
|
|
140
|
+
"cssSelector": String
|
|
141
|
+
},
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
selector 中可以为包含 expression 和 cssSelector 的对象或对象的数组。
|
|
145
|
+
|
|
146
|
+
- expression: 从当前节点查找塞入组件X的位置;
|
|
147
|
+
- cssSelector: X组件所使用的css选择器。
|
|
148
|
+
|
|
149
|
+
### additionalAttribute
|
|
150
|
+
|
|
151
|
+
选配,定义设计器内组件展示时额外传入的属性。书写格式为`"additionalAttribute": { key: value }` 。
|
|
152
|
+
|
|
153
|
+
**示例**
|
|
154
|
+
|
|
155
|
+
要求取消 react modal 在设计器里的弹出动画:
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
@ExtensionComponent({
|
|
159
|
+
"ideusage": {
|
|
160
|
+
"idetype": "modal",
|
|
161
|
+
...
|
|
162
|
+
"additionalAttribute": {
|
|
163
|
+
"transitionName": "''",
|
|
164
|
+
"maskStyle": "{{opacity: 1,animationDuration: '0s'}}"
|
|
165
|
+
},
|
|
166
|
+
"cacheOpenKey": "open"
|
|
167
|
+
}
|
|
168
|
+
})
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
> 需要注意,传入的键值对将直接放入模板翻译结果,需要对 " 等特殊符号做转义。
|
|
172
|
+
|
|
173
|
+
**IDE 中的效果**
|
|
174
|
+
|
|
175
|
+
拖拽生成组件后,在页面设计器中生成的代码如下:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
<Modal okText="确定" cancelText="取消"
|
|
179
|
+
key="component-24445f4bd7be4acdb923d4e53c06fe58"
|
|
180
|
+
open={true}
|
|
181
|
+
transitionName=''
|
|
182
|
+
maskStyle={{opacity: 1,animationDuration: '0s'}}
|
|
183
|
+
title={...}
|
|
184
|
+
footer={...}>
|
|
185
|
+
...
|
|
186
|
+
</Modal>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# popover 配置说明
|
|
6
|
+
|
|
7
|
+
类型为 "popover" 的组件为弹出框类的组件,这类组件一般分为两部分,触发弹出框和框体本身,触发部分一般不带本身的dom元素,以子组件的dom元素为触发事件来源。
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
@ExtensionComponent({
|
|
11
|
+
ideusage: {
|
|
12
|
+
"idetype": "popover"
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
下文以 vue 模板为例,展示配置和翻译器生层代码的匹配关系。React 相似。
|
|
18
|
+
|
|
19
|
+
示例
|
|
20
|
+
|
|
21
|
+
以 react 的下拉菜单组件 Dropdown 为例:
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
@ExtensionComponent({
|
|
27
|
+
"ideusage": {
|
|
28
|
+
"idetype": "popover",
|
|
29
|
+
"structured": true,
|
|
30
|
+
"namedSlotOmitWrapper": ["menuItem"],
|
|
31
|
+
"childAccept": {
|
|
32
|
+
"default": "this.getDefaultElements().length < 1",
|
|
33
|
+
"menuItem": "target.tag === 'MenuItem'"
|
|
34
|
+
},
|
|
35
|
+
"additionalAttribute": {
|
|
36
|
+
"menu": "{{ triggerSubMenuAction: 'click' }}",
|
|
37
|
+
"trigger": "{['click']}"
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
翻译后的模板为:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
<Dropdown key="component-7ce766fcfbea49b2a4e05497bda00fc5"
|
|
47
|
+
menu={{ triggerSubMenuAction: 'click' }}
|
|
48
|
+
trigger={['click']}
|
|
49
|
+
menuItem={(()=> (<>
|
|
50
|
+
<MenuItem data-nodepath="905aaedc246942ab960e37dac8c04456"
|
|
51
|
+
data-anonymous-nodepath="de07f9185b2b4143b8df73699f7a8214" label="导航项目" path="https://www.baidu.com"
|
|
52
|
+
key="component-905aaedc246942ab960e37dac8c04456" labelSlot={(()=> (<>
|
|
53
|
+
<div data-nodepath="bb28a4999c1748e08c4f2c67dbd1316e">
|
|
54
|
+
<EmptySlot data-emptyslot-nodepath="bb28a4999c1748e08c4f2c67dbd1316e"></EmptySlot>
|
|
55
|
+
</div>
|
|
56
|
+
</>))()} ></MenuItem>
|
|
57
|
+
<MenuItem data-nodepath="f63421583fac4df78ecd8aa45a35488a"
|
|
58
|
+
data-anonymous-nodepath="de07f9185b2b4143b8df73699f7a8214" label="导航项目2"
|
|
59
|
+
key="component-f63421583fac4df78ecd8aa45a35488a" labelSlot={(()=> (<>
|
|
60
|
+
<div data-nodepath="3a69cfcc46124eb299b760f70d29f807">
|
|
61
|
+
<EmptySlot data-emptyslot-nodepath="3a69cfcc46124eb299b760f70d29f807"></EmptySlot>
|
|
62
|
+
</div>
|
|
63
|
+
</>))()} ></MenuItem>
|
|
64
|
+
</>))()} >
|
|
65
|
+
<Link data-nodepath="9cc435699e93484e80bfaa584e637567"
|
|
66
|
+
data-anonymous-nodepath="7ce766fcfbea49b2a4e05497bda00fc5"
|
|
67
|
+
data-enable-interaction={bindref}
|
|
68
|
+
data-enable-events="click"
|
|
69
|
+
icon="RiArrowDownSLine"
|
|
70
|
+
children="按钮"
|
|
71
|
+
key="component-9cc435699e93484e80bfaa584e637567"
|
|
72
|
+
data-editable="true">
|
|
73
|
+
</Link>
|
|
74
|
+
</Dropdown>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
由于Dropdown没有自己对应的dom元素,所以通过data-anonymous-nodepath附着在了内部的Link上,Dropdown的 menuItem 只接受 MenuItem 组件,所以通过namedSlotOmitWrapper去除了原本会注入的外层div元素。
|
|
78
|
+
|
|
79
|
+
## 配置项说明
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### parentAccept
|
|
83
|
+
|
|
84
|
+
选配,定义可以放入当前组件的父组件。书写格式为`"parentAccept":"判断表达式"`,例如要求组件只能置入到面包屑组件 u-crumb 中:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
"parentAccept": "target.tag === 'u-crumb'"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### childAccept
|
|
91
|
+
|
|
92
|
+
选配,定义可以放入子组件的组件。书写格式为`"parentAccept":"判断表达式"`或`"parentAccept":Object`。
|
|
93
|
+
|
|
94
|
+
- 表达式形式:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
"childAccept": "target.tag === 'Radio'",
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
- 对象形式:key为slot中配置的名字,value是表达式
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
"childAccept": {
|
|
104
|
+
"default": "this.getDefaultElements().length < 1",
|
|
105
|
+
"menuItem": "target.tag === 'MenuItem'"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### selector
|
|
110
|
+
|
|
111
|
+
选配,若存在无法将data-nodepath 传入顶层DOM节点,可以通过设置此项绕行,绕行是通过向具体组件内部放入一个能够根据css选择器向上查找DOM节点的组件X。书写格式为:
|
|
112
|
+
|
|
113
|
+
"selector": [
|
|
114
|
+
{
|
|
115
|
+
"expression": String,
|
|
116
|
+
"cssSelector": String
|
|
117
|
+
},
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
selector 中可以为包含 expression 和 cssSelector 的对象或对象的数组。
|
|
121
|
+
|
|
122
|
+
- expression: 从当前节点查找塞入组件X的位置;
|
|
123
|
+
- cssSelector: X组件所使用的css选择器。
|
|
124
|
+
|
|
125
|
+
### structured
|
|
126
|
+
|
|
127
|
+
选配,定义当前组件的子组件的插入方式。书写格式为`"structured":true`或`"structured": false`。
|
|
128
|
+
|
|
129
|
+
- true:表示通过设计器内菜单中"+"插入;
|
|
130
|
+
- false:表示通过拖拽插入。
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### additionalAttribute
|
|
134
|
+
|
|
135
|
+
选配,定义设计器内组件展示时额外传入的属性。书写格式为`"additionalAttribute": { key: value }` 。
|
|
136
|
+
|
|
137
|
+
**示例**
|
|
138
|
+
|
|
139
|
+
要求取消 react modal 在设计器里的弹出动画:
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
@ExtensionComponent({
|
|
143
|
+
"ideusage": {
|
|
144
|
+
"idetype": "modal",
|
|
145
|
+
...
|
|
146
|
+
"additionalAttribute": {
|
|
147
|
+
"transitionName": "''",
|
|
148
|
+
"maskStyle": "{{opacity: 1,animationDuration: '0s'}}"
|
|
149
|
+
},
|
|
150
|
+
"cacheOpenKey": "open"
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
> 需要注意,传入的键值对将直接放入模板翻译结果,需要对 " 等特殊符号做转义。
|
|
156
|
+
|
|
157
|
+
**IDE 中的效果**
|
|
158
|
+
|
|
159
|
+
拖拽生成组件后,在页面设计器中生成的代码如下:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
<Modal okText="确定" cancelText="取消"
|
|
163
|
+
key="component-24445f4bd7be4acdb923d4e53c06fe58"
|
|
164
|
+
open={true}
|
|
165
|
+
transitionName=''
|
|
166
|
+
maskStyle={{opacity: 1,animationDuration: '0s'}}
|
|
167
|
+
title={...}
|
|
168
|
+
footer={...}>
|
|
169
|
+
...
|
|
170
|
+
</Modal>
|
|
171
|
+
```
|