matrix_components 2.0.393 → 2.0.400
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 +8 -1
- package/dist/matrix_components.css +1 -1
- package/dist/matrix_components.js +22 -23
- package/dist/matrix_components.umd.cjs +1 -1
- package/package.json +1 -1
- package/dist/ComponentDemo/DialogDemo.vue +0 -210
- package/dist/ComponentDemo/ExampleFormConfig.js +0 -270
- package/dist/ComponentDemo/ExcelDemo.vue +0 -263
- package/dist/ComponentDemo/FormDemo copy 2.vue +0 -658
- package/dist/ComponentDemo/FormDemo copy.vue +0 -656
- package/dist/ComponentDemo/FormDemo.vue +0 -622
- package/dist/ComponentDemo/ImageDemo.vue +0 -27
- package/dist/ComponentDemo/MDDemo.vue +0 -20
- package/dist/ComponentDemo/OfficeDemo.vue +0 -189
- package/dist/ComponentDemo/PdfDemo.vue +0 -207
- package/dist/ComponentDemo/SaturationLineDemo.vue +0 -592
- package/dist/ComponentDemo/SimpleFormConfig.json +0 -97
- package/dist/ComponentDemo/Test.vue +0 -437
- package/dist/ComponentDemo/TestFormConfig.js +0 -129
- package/dist/ComponentDemo/VideoDemo.vue +0 -303
- package/dist/ComponentDemo/WordDemo.vue +0 -191
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="padding: 20px;">
|
|
3
|
-
<h1>自定义指令演示 Demo</h1>
|
|
4
|
-
|
|
5
|
-
<!-- v-sline 指令演示 -->
|
|
6
|
-
<div class="demo-section">
|
|
7
|
-
<h2>1. v-sline 指令 - 单行文本溢出省略</h2>
|
|
8
|
-
<div style="width: 200px; border: 1px solid #ccc; padding: 10px;">
|
|
9
|
-
<p v-sline>这是一段很长很长很长很长很长很长的文本,用来测试单行省略效果</p>
|
|
10
|
-
</div>
|
|
11
|
-
<div style="width: 200px; border: 1px solid #ccc; padding: 10px; margin-top: 10px;">
|
|
12
|
-
<span v-sline>{{ longText }}</span>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<!-- v-length 指令演示 -->
|
|
17
|
-
<div class="demo-section">
|
|
18
|
-
<h2>2. v-length 指令 - 输入长度限制</h2>
|
|
19
|
-
|
|
20
|
-
<h3>基础用法 - 限制字符长度</h3>
|
|
21
|
-
<div class="input-group">
|
|
22
|
-
<label>限制5个字符:</label>
|
|
23
|
-
<el-input v-model="basicInput" v-length="5" placeholder="最多输入5个字符" style="width: 300px;" />
|
|
24
|
-
<span>当前: "{{ basicInput }}" ({{ basicInput.length }}/5)</span>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<h3>数字模式 - v-length.number</h3>
|
|
28
|
-
<div class="input-group">
|
|
29
|
-
<label>仅数字,限制8位:</label>
|
|
30
|
-
<el-input v-model="numberInput" v-length.number="8" placeholder="仅能输入数字,最多8位" style="width: 300px;" />
|
|
31
|
-
<span>当前: "{{ numberInput }}" ({{ numberInput.length }}/8)</span>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<h3>正则模式(不支持小数,使用v-length.range) - v-length.regex</h3>
|
|
35
|
-
<div class="input-group">
|
|
36
|
-
<label>字母数字,限制6位:</label>
|
|
37
|
-
<el-input
|
|
38
|
-
v-model="regexInput"
|
|
39
|
-
v-length.regex="{ maxLength: 6, pattern: /^[a-zA-Z0-9]*$/ }"
|
|
40
|
-
placeholder="仅字母数字,最多6位"
|
|
41
|
-
style="width: 300px;"
|
|
42
|
-
/>
|
|
43
|
-
<span>当前: "{{ regexInput }}" ({{ regexInput.length }}/6)</span>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<h3>范围模式 - v-length.range</h3>
|
|
47
|
-
<div class="input-group">
|
|
48
|
-
<label>数字范围 0-100:</label>
|
|
49
|
-
<el-input
|
|
50
|
-
v-model="rangeInput1"
|
|
51
|
-
v-length.range="{ min: 0, max: 100 }"
|
|
52
|
-
placeholder="输入0-100之间的数字"
|
|
53
|
-
style="width: 300px;"
|
|
54
|
-
/>
|
|
55
|
-
<span>当前: "{{ rangeInput1 }}"</span>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<div class="input-group">
|
|
59
|
-
<label>负数范围 -50到50:</label>
|
|
60
|
-
<el-input
|
|
61
|
-
v-model="rangeInput2"
|
|
62
|
-
v-length.range="{ min: -50, max: 50, maxLength: 10 }"
|
|
63
|
-
placeholder="输入-50到50之间的数字"
|
|
64
|
-
style="width: 300px;"
|
|
65
|
-
/>
|
|
66
|
-
<span>当前: "{{ rangeInput2 }}"</span>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<div class="input-group">
|
|
70
|
-
<label>小数范围 0.1-99.9:</label>
|
|
71
|
-
<el-input
|
|
72
|
-
v-model="rangeInput3"
|
|
73
|
-
v-length.range="{ min: 0.1, max: 99.9 }"
|
|
74
|
-
placeholder="输入0.1-99.9之间的小数"
|
|
75
|
-
style="width: 300px;"
|
|
76
|
-
/>
|
|
77
|
-
<span>当前: "{{ rangeInput3 }}"</span>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div class="input-group">
|
|
81
|
-
<label>百分比范围 0-100%:</label>
|
|
82
|
-
<el-input
|
|
83
|
-
v-model="rangeInput4"
|
|
84
|
-
v-length.range="{ min: 0, max: 100, maxLength: 5 }"
|
|
85
|
-
placeholder="输入0-100之间的百分比数值"
|
|
86
|
-
style="width: 300px;"
|
|
87
|
-
>
|
|
88
|
-
<template #suffix>%</template>
|
|
89
|
-
</el-input>
|
|
90
|
-
<span>当前: "{{ rangeInput4 }}%"</span>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<h3>整数范围模式 - v-length.range (int)</h3>
|
|
94
|
-
<div class="input-group">
|
|
95
|
-
<label>整数范围 0-100 (仅整数):</label>
|
|
96
|
-
<el-input
|
|
97
|
-
v-model="rangeInput5"
|
|
98
|
-
v-length.range="{ min: 0, max: 100, int: true }"
|
|
99
|
-
placeholder="仅能输入0-100之间的整数"
|
|
100
|
-
style="width: 300px;"
|
|
101
|
-
/>
|
|
102
|
-
<span>当前: "{{ rangeInput5 }}"</span>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<div class="input-group">
|
|
106
|
-
<label>年龄范围 1-120 (仅整数):</label>
|
|
107
|
-
<el-input
|
|
108
|
-
v-model="rangeInput6"
|
|
109
|
-
v-length.range="{ min: 1, max: 120, int: true, maxLength: 3 }"
|
|
110
|
-
placeholder="输入年龄1-120岁"
|
|
111
|
-
style="width: 300px;"
|
|
112
|
-
/>
|
|
113
|
-
<span>当前: "{{ rangeInput6 }}"岁</span>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<div class="input-group">
|
|
117
|
-
<label>负整数范围 -10到10 (仅整数):</label>
|
|
118
|
-
<el-input
|
|
119
|
-
v-model="rangeInput7"
|
|
120
|
-
v-length.range="{ min: -10, max: 10, int: true }"
|
|
121
|
-
placeholder="输入-10到10之间的整数"
|
|
122
|
-
style="width: 300px;"
|
|
123
|
-
/>
|
|
124
|
-
<span>当前: "{{ rangeInput7 }}"</span>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<!-- v-permission 指令演示 -->
|
|
129
|
-
<div class="demo-section">
|
|
130
|
-
<h2>3. v-permission 指令 - 按钮权限控制</h2>
|
|
131
|
-
<p>当前权限列表: {{ btnsPermission.join(', ') }}</p>
|
|
132
|
-
|
|
133
|
-
<h3>ID 权限控制 (默认模式)</h3>
|
|
134
|
-
<div class="button-group">
|
|
135
|
-
<el-button id="add_btn" v-permission type="primary">添加按钮 (有权限)</el-button>
|
|
136
|
-
<el-button id="edit_btn" v-permission type="success">编辑按钮 (有权限)</el-button>
|
|
137
|
-
<el-button id="delete_btn" v-permission type="danger">删除按钮 (无权限-隐藏)</el-button>
|
|
138
|
-
<el-button id="view_btn" v-permission type="info">查看按钮 (无权限-隐藏)</el-button>
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
<h3>ID 权限控制 (display模式)</h3>
|
|
142
|
-
<div class="button-group">
|
|
143
|
-
<el-button id="export_btn" v-permission.id.display type="warning">导出按钮 (无权限-display:none)</el-button>
|
|
144
|
-
<el-button id="import_btn" v-permission.id.display type="primary">导入按钮 (无权限-display:none)</el-button>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
<h3>Class 权限控制</h3>
|
|
148
|
-
<div class="button-group">
|
|
149
|
-
<el-button class="admin-btn" v-permission.class type="primary">管理员按钮 (有权限)</el-button>
|
|
150
|
-
<el-button class="super-admin" v-permission.class type="danger">超级管理员 (无权限)</el-button>
|
|
151
|
-
</div>
|
|
152
|
-
|
|
153
|
-
<div style="margin-top: 10px;">
|
|
154
|
-
<el-button @click="togglePermission" type="primary">切换权限</el-button>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
|
|
158
|
-
<!-- v-event-unuse 和 v-event-use 指令演示 -->
|
|
159
|
-
<div class="demo-section">
|
|
160
|
-
<h2>4. v-event-unuse / v-event-use 指令 - 事件穿透控制</h2>
|
|
161
|
-
|
|
162
|
-
<div class="event-demo-container" v-event-unuse @click="parentClick">
|
|
163
|
-
<p>父容器 (v-event-unuse) - 点击事件被禁用</p>
|
|
164
|
-
<div class="child-container" v-event-use @click="childClick">
|
|
165
|
-
<p>子容器 (v-event-use) - 点击事件可用</p>
|
|
166
|
-
<el-button type="primary">可点击的按钮</el-button>
|
|
167
|
-
</div>
|
|
168
|
-
<el-button type="danger">不可点击的按钮</el-button>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<p>点击结果: {{ eventResult }}</p>
|
|
172
|
-
</div>
|
|
173
|
-
|
|
174
|
-
<!-- 综合演示 -->
|
|
175
|
-
<div class="demo-section">
|
|
176
|
-
<h2>5. 综合演示</h2>
|
|
177
|
-
<div class="comprehensive-demo">
|
|
178
|
-
<div class="form-item">
|
|
179
|
-
<label>用户名 (字母数字,最多8位):</label>
|
|
180
|
-
<el-input
|
|
181
|
-
v-model="username"
|
|
182
|
-
v-length.regex="{ maxLength: 8, pattern: /^[a-zA-Z0-9]*$/ }"
|
|
183
|
-
placeholder="用户名"
|
|
184
|
-
style="width: 200px;"
|
|
185
|
-
/>
|
|
186
|
-
</div>
|
|
187
|
-
|
|
188
|
-
<div class="form-item">
|
|
189
|
-
<label>年龄 (数字,最多3位):</label>
|
|
190
|
-
<el-input
|
|
191
|
-
v-model="age"
|
|
192
|
-
v-length.number="3"
|
|
193
|
-
placeholder="年龄"
|
|
194
|
-
style="width: 200px;"
|
|
195
|
-
/>
|
|
196
|
-
</div>
|
|
197
|
-
|
|
198
|
-
<div class="form-item">
|
|
199
|
-
<label>描述 (最多50字符):</label>
|
|
200
|
-
<el-input
|
|
201
|
-
v-model="description"
|
|
202
|
-
v-length="50"
|
|
203
|
-
type="textarea"
|
|
204
|
-
placeholder="个人描述"
|
|
205
|
-
style="width: 300px;"
|
|
206
|
-
/>
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
<div class="form-item">
|
|
210
|
-
<label>长文本展示:</label>
|
|
211
|
-
<div style="width: 200px; border: 1px solid #ddd; padding: 8px;">
|
|
212
|
-
<span v-sline>{{ description || '这里会显示你输入的描述,如果太长会自动省略...' }}</span>
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
|
|
216
|
-
<div class="form-item">
|
|
217
|
-
<el-button id="save_btn" v-permission type="primary">保存 (需要权限)</el-button>
|
|
218
|
-
<el-button @click="clearForm" type="default">清空</el-button>
|
|
219
|
-
</div>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
</template>
|
|
224
|
-
<script setup lang="ts">
|
|
225
|
-
import { ref, provide } from 'vue'
|
|
226
|
-
|
|
227
|
-
// v-sline 演示数据
|
|
228
|
-
const longText = ref('这是一个非常非常非常长的文本内容,用来演示v-sline指令的单行省略效果,当文本超出容器宽度时会自动显示省略号')
|
|
229
|
-
|
|
230
|
-
// v-length 演示数据
|
|
231
|
-
const basicInput = ref('')
|
|
232
|
-
const nativeInput = ref('')
|
|
233
|
-
const numberInput = ref('')
|
|
234
|
-
const regexInput = ref('')
|
|
235
|
-
const chineseInput = ref('')
|
|
236
|
-
const autocompleteInput = ref('')
|
|
237
|
-
|
|
238
|
-
// v-length.range 演示数据
|
|
239
|
-
const rangeInput1 = ref('')
|
|
240
|
-
const rangeInput2 = ref('')
|
|
241
|
-
const rangeInput3 = ref('')
|
|
242
|
-
const rangeInput4 = ref('')
|
|
243
|
-
const rangeInput5 = ref('')
|
|
244
|
-
const rangeInput6 = ref('')
|
|
245
|
-
const rangeInput7 = ref('')
|
|
246
|
-
|
|
247
|
-
// v-permission 演示数据
|
|
248
|
-
const btnsPermission = ref(JSON.parse(sessionStorage.getItem('btnsPermission')) || ['add_btn', 'edit_btn', 'admin-btn'])
|
|
249
|
-
sessionStorage.setItem('btnsPermission', JSON.stringify(btnsPermission.value))
|
|
250
|
-
// v-event 演示数据
|
|
251
|
-
const eventResult = ref('暂无点击')
|
|
252
|
-
|
|
253
|
-
// 综合演示数据
|
|
254
|
-
const username = ref('')
|
|
255
|
-
const age = ref('')
|
|
256
|
-
const description = ref('')
|
|
257
|
-
// 自动完成搜索函数
|
|
258
|
-
function querySearch(queryString: string, cb: (results: Array<{ value: string }>) => void) {
|
|
259
|
-
const results = queryString
|
|
260
|
-
? [
|
|
261
|
-
{ value: '测试用户1' },
|
|
262
|
-
{ value: '测试用户2' },
|
|
263
|
-
{ value: '管理员' },
|
|
264
|
-
{ value: '普通用户' },
|
|
265
|
-
{ value: '访客' }
|
|
266
|
-
].filter(item => item.value.includes(queryString))
|
|
267
|
-
: []
|
|
268
|
-
cb(results)
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// 权限切换函数 - 修复无限递归问题
|
|
272
|
-
function togglePermission() {
|
|
273
|
-
if (btnsPermission.value.includes('delete_btn')) {
|
|
274
|
-
// 移除权限
|
|
275
|
-
btnsPermission.value = btnsPermission.value.filter(item =>
|
|
276
|
-
!['delete_btn', 'save_btn', 'view_btn', 'export_btn', 'import_btn'].includes(item)
|
|
277
|
-
)
|
|
278
|
-
eventResult.value = '权限已移除,页面将在1秒后刷新以应用更改'
|
|
279
|
-
} else {
|
|
280
|
-
// 添加权限
|
|
281
|
-
const newPermissions = ['delete_btn', 'save_btn', 'view_btn', 'export_btn', 'import_btn']
|
|
282
|
-
newPermissions.forEach(permission => {
|
|
283
|
-
if (!btnsPermission.value.includes(permission)) {
|
|
284
|
-
btnsPermission.value.push(permission)
|
|
285
|
-
}
|
|
286
|
-
})
|
|
287
|
-
eventResult.value = '权限已添加,页面将在1秒后刷新以应用更改'
|
|
288
|
-
}
|
|
289
|
-
sessionStorage.setItem('btnsPermission', JSON.stringify(btnsPermission.value))
|
|
290
|
-
// 延迟刷新页面以应用权限变更
|
|
291
|
-
setTimeout(() => {
|
|
292
|
-
window.location.reload()
|
|
293
|
-
}, 1000)
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// 事件演示函数
|
|
297
|
-
function parentClick() {
|
|
298
|
-
eventResult.value = '父容器被点击了 - 这不应该发生,因为使用了v-event-unuse'
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
function childClick(event: Event) {
|
|
302
|
-
event.stopPropagation()
|
|
303
|
-
eventResult.value = '子容器被点击了 - v-event-use生效'
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// 清空表单
|
|
307
|
-
function clearForm() {
|
|
308
|
-
username.value = ''
|
|
309
|
-
age.value = ''
|
|
310
|
-
description.value = ''
|
|
311
|
-
basicInput.value = ''
|
|
312
|
-
nativeInput.value = ''
|
|
313
|
-
numberInput.value = ''
|
|
314
|
-
regexInput.value = ''
|
|
315
|
-
chineseInput.value = ''
|
|
316
|
-
autocompleteInput.value = ''
|
|
317
|
-
eventResult.value = '表单已清空'
|
|
318
|
-
}
|
|
319
|
-
</script>
|
|
320
|
-
<style scoped>
|
|
321
|
-
.demo-section {
|
|
322
|
-
margin-bottom: 40px;
|
|
323
|
-
padding: 20px;
|
|
324
|
-
border: 1px solid #e4e7ed;
|
|
325
|
-
border-radius: 8px;
|
|
326
|
-
background-color: #fafafa;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.demo-section h2 {
|
|
330
|
-
color: #409eff;
|
|
331
|
-
margin-bottom: 20px;
|
|
332
|
-
border-bottom: 2px solid #409eff;
|
|
333
|
-
padding-bottom: 10px;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.demo-section h3 {
|
|
337
|
-
color: #606266;
|
|
338
|
-
margin: 20px 0 10px 0;
|
|
339
|
-
font-size: 16px;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.input-group {
|
|
343
|
-
display: flex;
|
|
344
|
-
align-items: center;
|
|
345
|
-
margin-bottom: 15px;
|
|
346
|
-
gap: 10px;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.input-group label {
|
|
350
|
-
min-width: 150px;
|
|
351
|
-
font-weight: 500;
|
|
352
|
-
color: #606266;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.input-group span {
|
|
356
|
-
color: #909399;
|
|
357
|
-
font-size: 14px;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.native-input {
|
|
361
|
-
width: 300px;
|
|
362
|
-
padding: 8px 12px;
|
|
363
|
-
border: 1px solid #dcdfe6;
|
|
364
|
-
border-radius: 4px;
|
|
365
|
-
font-size: 14px;
|
|
366
|
-
transition: border-color 0.2s;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.native-input:focus {
|
|
370
|
-
outline: none;
|
|
371
|
-
border-color: #409eff;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
.button-group {
|
|
375
|
-
display: flex;
|
|
376
|
-
gap: 10px;
|
|
377
|
-
margin-bottom: 15px;
|
|
378
|
-
flex-wrap: wrap;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.event-demo-container {
|
|
382
|
-
border: 2px solid #f56c6c;
|
|
383
|
-
padding: 20px;
|
|
384
|
-
margin: 20px 0;
|
|
385
|
-
border-radius: 8px;
|
|
386
|
-
background-color: #fef0f0;
|
|
387
|
-
cursor: pointer;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.child-container {
|
|
391
|
-
border: 2px solid #67c23a;
|
|
392
|
-
padding: 15px;
|
|
393
|
-
margin: 10px 0;
|
|
394
|
-
border-radius: 6px;
|
|
395
|
-
background-color: #f0f9ff;
|
|
396
|
-
cursor: pointer;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.comprehensive-demo {
|
|
400
|
-
background-color: #fff;
|
|
401
|
-
padding: 20px;
|
|
402
|
-
border-radius: 8px;
|
|
403
|
-
border: 1px solid #e4e7ed;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.form-item {
|
|
407
|
-
display: flex;
|
|
408
|
-
align-items: center;
|
|
409
|
-
margin-bottom: 20px;
|
|
410
|
-
gap: 15px;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
.form-item label {
|
|
414
|
-
min-width: 200px;
|
|
415
|
-
font-weight: 500;
|
|
416
|
-
color: #606266;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
/* 响应式设计 */
|
|
420
|
-
@media (max-width: 768px) {
|
|
421
|
-
.input-group,
|
|
422
|
-
.form-item {
|
|
423
|
-
flex-direction: column;
|
|
424
|
-
align-items: flex-start;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.input-group label,
|
|
428
|
-
.form-item label {
|
|
429
|
-
min-width: auto;
|
|
430
|
-
margin-bottom: 5px;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
.button-group {
|
|
434
|
-
flex-direction: column;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
</style>
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// 测试表单配置文件 - 用于验证默认值加载功能
|
|
2
|
-
export const formConfig = {
|
|
3
|
-
// 表单数据初始值
|
|
4
|
-
formData: {
|
|
5
|
-
testName: "默认姓名",
|
|
6
|
-
testEmail: "default@example.com",
|
|
7
|
-
testAge: 25,
|
|
8
|
-
testGender: "male",
|
|
9
|
-
testHobbies: ["reading", "music"],
|
|
10
|
-
testIsVip: true,
|
|
11
|
-
testScore: 80,
|
|
12
|
-
testBirthday: "1998-01-01",
|
|
13
|
-
testDescription: "这是默认的描述信息",
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
// 表单配置项
|
|
17
|
-
formItems: [
|
|
18
|
-
{
|
|
19
|
-
label: "姓名",
|
|
20
|
-
prop: "testName",
|
|
21
|
-
component: "input",
|
|
22
|
-
span: 12,
|
|
23
|
-
required: true,
|
|
24
|
-
placeholder: "请输入姓名",
|
|
25
|
-
props: {
|
|
26
|
-
clearable: true,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "邮箱",
|
|
31
|
-
prop: "testEmail",
|
|
32
|
-
component: "input",
|
|
33
|
-
span: 12,
|
|
34
|
-
required: true,
|
|
35
|
-
props: {
|
|
36
|
-
clearable: true,
|
|
37
|
-
},
|
|
38
|
-
rules: [
|
|
39
|
-
{ type: "email", message: "请输入正确的邮箱地址", trigger: "blur" },
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: "年龄",
|
|
44
|
-
prop: "testAge",
|
|
45
|
-
component: "number",
|
|
46
|
-
span: 12,
|
|
47
|
-
props: {
|
|
48
|
-
min: 1,
|
|
49
|
-
max: 120,
|
|
50
|
-
controlsPosition: "right",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: "性别",
|
|
55
|
-
prop: "testGender",
|
|
56
|
-
component: "radio-group",
|
|
57
|
-
span: 12,
|
|
58
|
-
options: [
|
|
59
|
-
{ label: "男", value: "male" },
|
|
60
|
-
{ label: "女", value: "female" },
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: "爱好",
|
|
65
|
-
prop: "testHobbies",
|
|
66
|
-
component: "checkbox-group",
|
|
67
|
-
span: 24,
|
|
68
|
-
options: [
|
|
69
|
-
{ label: "读书", value: "reading" },
|
|
70
|
-
{ label: "运动", value: "sports" },
|
|
71
|
-
{ label: "音乐", value: "music" },
|
|
72
|
-
{ label: "旅行", value: "travel" },
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "VIP用户",
|
|
77
|
-
prop: "testIsVip",
|
|
78
|
-
component: "switch",
|
|
79
|
-
span: 12,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: "评分",
|
|
83
|
-
prop: "testScore",
|
|
84
|
-
component: "slider",
|
|
85
|
-
span: 12,
|
|
86
|
-
props: {
|
|
87
|
-
min: 0,
|
|
88
|
-
max: 100,
|
|
89
|
-
showStops: true,
|
|
90
|
-
showTooltip: false,
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: "生日",
|
|
95
|
-
prop: "testBirthday",
|
|
96
|
-
component: "date-picker",
|
|
97
|
-
span: 12,
|
|
98
|
-
props: {
|
|
99
|
-
type: "date",
|
|
100
|
-
format: "YYYY-MM-DD",
|
|
101
|
-
valueFormat: "YYYY-MM-DD",
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
label: "描述",
|
|
106
|
-
prop: "testDescription",
|
|
107
|
-
component: "textarea",
|
|
108
|
-
span: 24,
|
|
109
|
-
props: {
|
|
110
|
-
rows: 4,
|
|
111
|
-
maxlength: 200,
|
|
112
|
-
showWordLimit: true,
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
|
|
117
|
-
// 表单验证规则
|
|
118
|
-
formRules: {
|
|
119
|
-
testName: [
|
|
120
|
-
{ required: true, message: "请输入姓名"},
|
|
121
|
-
],
|
|
122
|
-
testEmail: [{ required: true, message: "请输入邮箱地址"}],
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
// 下拉框选项数据源
|
|
126
|
-
optionsData: {},
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export default formConfig;
|