matrix_components 2.0.316 → 2.0.317
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 +7 -0
- package/dist/matrix_components.css +1 -1
- package/dist/matrix_components.js +43 -22
- 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.vue +0 -400
- package/dist/ComponentDemo/ImageDemo.vue +0 -143
- 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 -158
- package/dist/ComponentDemo/SimpleFormConfig.json +0 -97
- package/dist/ComponentDemo/Test.vue +0 -347
- package/dist/ComponentDemo/TestFormConfig.js +0 -129
- package/dist/ComponentDemo/VideoDemo.vue +0 -297
- package/dist/ComponentDemo/WordDemo.vue +0 -191
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="saturation-line-view">
|
|
3
|
-
<span>浸润线</span>
|
|
4
|
-
<NsSaturationline ref="canvasRef" class="saturationline-canvas" :data="state.damData" :waterLevel="state.waterLevel"></NsSaturationline>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
<script setup lang="ts" name="">
|
|
8
|
-
import { reactive } from 'vue';
|
|
9
|
-
|
|
10
|
-
const state = reactive({
|
|
11
|
-
damData: {
|
|
12
|
-
// 坝体
|
|
13
|
-
sectionTableList: [
|
|
14
|
-
{
|
|
15
|
-
xPoint: "-44",
|
|
16
|
-
yPoint: "17",
|
|
17
|
-
isTop: false,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
xPoint: "-26",
|
|
21
|
-
yPoint: "24",
|
|
22
|
-
isTop: false,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
xPoint: "-16",
|
|
26
|
-
yPoint: "24",
|
|
27
|
-
isTop: false,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
xPoint: "-8",
|
|
31
|
-
yPoint: "29",
|
|
32
|
-
isTop: true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
xPoint: "8",
|
|
36
|
-
yPoint: "29",
|
|
37
|
-
isTop: true,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
xPoint: "22",
|
|
41
|
-
yPoint: "25",
|
|
42
|
-
isTop: false,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
xPoint: "40",
|
|
46
|
-
yPoint: "22",
|
|
47
|
-
isTop: false,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
xPoint: "47",
|
|
51
|
-
yPoint: "22",
|
|
52
|
-
isTop: false,
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
xPoint: "62",
|
|
56
|
-
yPoint: "17",
|
|
57
|
-
isTop: false,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
xPoint: "70",
|
|
61
|
-
yPoint: "17",
|
|
62
|
-
isTop: false,
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
// 测压管
|
|
66
|
-
pipelineTableList: [
|
|
67
|
-
{
|
|
68
|
-
xPoint: "-8",
|
|
69
|
-
yPoint: "29",
|
|
70
|
-
height: "15",
|
|
71
|
-
pointCode: "UP1-1",
|
|
72
|
-
pointName: "测试名字很长很长很长很长测试名字很长很长很长很长",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
xPoint: "8",
|
|
76
|
-
yPoint: "29",
|
|
77
|
-
height: "17",
|
|
78
|
-
pointCode: "UP1-2",
|
|
79
|
-
pointName: "-1-1-1--1-1----1",
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
xPoint: "17",
|
|
83
|
-
yPoint: "26.3",
|
|
84
|
-
height: "15",
|
|
85
|
-
pointCode: "UP1-3",
|
|
86
|
-
pointName: "测试",
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
// y/x偏移
|
|
90
|
-
isWall: "1",
|
|
91
|
-
yStart: "10",
|
|
92
|
-
wallXpoint: "-2",
|
|
93
|
-
},
|
|
94
|
-
waterLevel: {
|
|
95
|
-
map: [
|
|
96
|
-
{
|
|
97
|
-
id: null,
|
|
98
|
-
projectCode: null,
|
|
99
|
-
transectName: "0+155",
|
|
100
|
-
pointCode: "UP1-3",
|
|
101
|
-
waterLevel: 14.8,
|
|
102
|
-
date: "2025-05-20T05:00:00",
|
|
103
|
-
createBy: null,
|
|
104
|
-
createTime: null,
|
|
105
|
-
updateBy: null,
|
|
106
|
-
updateTime: null,
|
|
107
|
-
isDelete: null,
|
|
108
|
-
code: null,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
id: null,
|
|
112
|
-
projectCode: null,
|
|
113
|
-
transectName: "0+155",
|
|
114
|
-
pointCode: "UP1-2",
|
|
115
|
-
waterLevel: 16.0,
|
|
116
|
-
date: "2025-05-20T05:00:00",
|
|
117
|
-
createBy: null,
|
|
118
|
-
createTime: null,
|
|
119
|
-
updateBy: null,
|
|
120
|
-
updateTime: null,
|
|
121
|
-
isDelete: null,
|
|
122
|
-
code: null,
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
id: null,
|
|
126
|
-
projectCode: null,
|
|
127
|
-
transectName: "0+155",
|
|
128
|
-
pointCode: "UP1-1",
|
|
129
|
-
waterLevel: 18.3,
|
|
130
|
-
date: "2025-05-20T00:00:00",
|
|
131
|
-
createBy: null,
|
|
132
|
-
createTime: null,
|
|
133
|
-
updateBy: null,
|
|
134
|
-
updateTime: null,
|
|
135
|
-
isDelete: null,
|
|
136
|
-
code: null,
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
kssw: 22,
|
|
140
|
-
xxsw: 15,
|
|
141
|
-
sjsw: 24,
|
|
142
|
-
jhsw: 26,
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
</script>
|
|
146
|
-
<style lang="scss" scoped>
|
|
147
|
-
.saturation-line-view {
|
|
148
|
-
width: calc(100% - 40px);
|
|
149
|
-
height: calc(100% - 20px);
|
|
150
|
-
padding: 20px;
|
|
151
|
-
display: flex;
|
|
152
|
-
flex-direction: column;
|
|
153
|
-
.saturationline-canvas {
|
|
154
|
-
flex: 1;
|
|
155
|
-
height: 100%;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
</style>
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"formData": {
|
|
3
|
-
"name": "xx",
|
|
4
|
-
"email": "yy@zz.com",
|
|
5
|
-
"age": null,
|
|
6
|
-
"city": "",
|
|
7
|
-
"description": ""
|
|
8
|
-
},
|
|
9
|
-
"formItems": [
|
|
10
|
-
{
|
|
11
|
-
"label": "姓名",
|
|
12
|
-
"prop": "name",
|
|
13
|
-
"component": "input",
|
|
14
|
-
"span": 24,
|
|
15
|
-
"required": true,
|
|
16
|
-
"placeholder": "请输入姓名",
|
|
17
|
-
"props": {
|
|
18
|
-
"clearable": true
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"label": "邮箱",
|
|
23
|
-
"prop": "email",
|
|
24
|
-
"component": "input",
|
|
25
|
-
"span": 24,
|
|
26
|
-
"required": true,
|
|
27
|
-
"placeholder": "请输入邮箱",
|
|
28
|
-
"props": {
|
|
29
|
-
"clearable": true
|
|
30
|
-
},
|
|
31
|
-
"rules": [
|
|
32
|
-
{
|
|
33
|
-
"type": "email",
|
|
34
|
-
"message": "请输入正确的邮箱地址",
|
|
35
|
-
"trigger": "blur"
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"label": "年龄",
|
|
41
|
-
"prop": "age",
|
|
42
|
-
"component": "number",
|
|
43
|
-
"span": 24,
|
|
44
|
-
"placeholder": "请输入年龄",
|
|
45
|
-
"props": {
|
|
46
|
-
"min": 1,
|
|
47
|
-
"max": 120,
|
|
48
|
-
"controlsPosition": "right"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"label": "城市",
|
|
53
|
-
"prop": "city",
|
|
54
|
-
"component": "select",
|
|
55
|
-
"span": 24,
|
|
56
|
-
"placeholder": "请选择城市",
|
|
57
|
-
"options": [
|
|
58
|
-
{ "label": "北京", "value": "beijing" },
|
|
59
|
-
{ "label": "上海", "value": "shanghai" },
|
|
60
|
-
{ "label": "广州", "value": "guangzhou" },
|
|
61
|
-
{ "label": "深圳", "value": "shenzhen" }
|
|
62
|
-
],
|
|
63
|
-
"props": {
|
|
64
|
-
"clearable": true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"label": "描述",
|
|
69
|
-
"prop": "description",
|
|
70
|
-
"component": "textarea",
|
|
71
|
-
"span": 24,
|
|
72
|
-
"placeholder": "请输入描述",
|
|
73
|
-
"props": {
|
|
74
|
-
"rows": 3,
|
|
75
|
-
"maxlength": 200,
|
|
76
|
-
"showWordLimit": true
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"formRules": {
|
|
81
|
-
"name": [
|
|
82
|
-
{
|
|
83
|
-
"required": true,
|
|
84
|
-
"message": "请输入姓名",
|
|
85
|
-
"trigger": "blur"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"email": [
|
|
89
|
-
{
|
|
90
|
-
"required": true,
|
|
91
|
-
"message": "请输入邮箱地址",
|
|
92
|
-
"trigger": "blur"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
"optionsData": {}
|
|
97
|
-
}
|
|
@@ -1,347 +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.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
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<!-- v-permission 指令演示 -->
|
|
48
|
-
<div class="demo-section">
|
|
49
|
-
<h2>3. v-permission 指令 - 按钮权限控制</h2>
|
|
50
|
-
<p>当前权限列表: {{ btnsPermission.join(', ') }}</p>
|
|
51
|
-
|
|
52
|
-
<h3>ID 权限控制 (默认模式)</h3>
|
|
53
|
-
<div class="button-group">
|
|
54
|
-
<el-button id="add_btn" v-permission type="primary">添加按钮 (有权限)</el-button>
|
|
55
|
-
<el-button id="edit_btn" v-permission type="success">编辑按钮 (有权限)</el-button>
|
|
56
|
-
<el-button id="delete_btn" v-permission type="danger">删除按钮 (无权限-隐藏)</el-button>
|
|
57
|
-
<el-button id="view_btn" v-permission type="info">查看按钮 (无权限-隐藏)</el-button>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<h3>ID 权限控制 (display模式)</h3>
|
|
61
|
-
<div class="button-group">
|
|
62
|
-
<el-button id="export_btn" v-permission.id.display type="warning">导出按钮 (无权限-display:none)</el-button>
|
|
63
|
-
<el-button id="import_btn" v-permission.id.display type="primary">导入按钮 (无权限-display:none)</el-button>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<h3>Class 权限控制</h3>
|
|
67
|
-
<div class="button-group">
|
|
68
|
-
<el-button class="admin-btn" v-permission.class type="primary">管理员按钮 (有权限)</el-button>
|
|
69
|
-
<el-button class="super-admin" v-permission.class type="danger">超级管理员 (无权限)</el-button>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<div style="margin-top: 10px;">
|
|
73
|
-
<el-button @click="togglePermission" type="primary">切换权限</el-button>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<!-- v-event-unuse 和 v-event-use 指令演示 -->
|
|
78
|
-
<div class="demo-section">
|
|
79
|
-
<h2>4. v-event-unuse / v-event-use 指令 - 事件穿透控制</h2>
|
|
80
|
-
|
|
81
|
-
<div class="event-demo-container" v-event-unuse @click="parentClick">
|
|
82
|
-
<p>父容器 (v-event-unuse) - 点击事件被禁用</p>
|
|
83
|
-
<div class="child-container" v-event-use @click="childClick">
|
|
84
|
-
<p>子容器 (v-event-use) - 点击事件可用</p>
|
|
85
|
-
<el-button type="primary">可点击的按钮</el-button>
|
|
86
|
-
</div>
|
|
87
|
-
<el-button type="danger">不可点击的按钮</el-button>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<p>点击结果: {{ eventResult }}</p>
|
|
91
|
-
</div>
|
|
92
|
-
|
|
93
|
-
<!-- 综合演示 -->
|
|
94
|
-
<div class="demo-section">
|
|
95
|
-
<h2>5. 综合演示</h2>
|
|
96
|
-
<div class="comprehensive-demo">
|
|
97
|
-
<div class="form-item">
|
|
98
|
-
<label>用户名 (字母数字,最多8位):</label>
|
|
99
|
-
<el-input
|
|
100
|
-
v-model="username"
|
|
101
|
-
v-length.regex="{ maxLength: 8, pattern: /^[a-zA-Z0-9]*$/ }"
|
|
102
|
-
placeholder="用户名"
|
|
103
|
-
style="width: 200px;"
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div class="form-item">
|
|
108
|
-
<label>年龄 (数字,最多3位):</label>
|
|
109
|
-
<el-input
|
|
110
|
-
v-model="age"
|
|
111
|
-
v-length.number="3"
|
|
112
|
-
placeholder="年龄"
|
|
113
|
-
style="width: 200px;"
|
|
114
|
-
/>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<div class="form-item">
|
|
118
|
-
<label>描述 (最多50字符):</label>
|
|
119
|
-
<el-input
|
|
120
|
-
v-model="description"
|
|
121
|
-
v-length="50"
|
|
122
|
-
type="textarea"
|
|
123
|
-
placeholder="个人描述"
|
|
124
|
-
style="width: 300px;"
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<div class="form-item">
|
|
129
|
-
<label>长文本展示:</label>
|
|
130
|
-
<div style="width: 200px; border: 1px solid #ddd; padding: 8px;">
|
|
131
|
-
<span v-sline>{{ description || '这里会显示你输入的描述,如果太长会自动省略...' }}</span>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<div class="form-item">
|
|
136
|
-
<el-button id="save_btn" v-permission type="primary">保存 (需要权限)</el-button>
|
|
137
|
-
<el-button @click="clearForm" type="default">清空</el-button>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
</template>
|
|
143
|
-
<script setup lang="ts">
|
|
144
|
-
import { ref, provide } from 'vue'
|
|
145
|
-
|
|
146
|
-
// v-sline 演示数据
|
|
147
|
-
const longText = ref('这是一个非常非常非常长的文本内容,用来演示v-sline指令的单行省略效果,当文本超出容器宽度时会自动显示省略号')
|
|
148
|
-
|
|
149
|
-
// v-length 演示数据
|
|
150
|
-
const basicInput = ref('')
|
|
151
|
-
const nativeInput = ref('')
|
|
152
|
-
const numberInput = ref('')
|
|
153
|
-
const regexInput = ref('')
|
|
154
|
-
const chineseInput = ref('')
|
|
155
|
-
const autocompleteInput = ref('')
|
|
156
|
-
|
|
157
|
-
// v-permission 演示数据
|
|
158
|
-
const btnsPermission = ref(JSON.parse(sessionStorage.getItem('btnsPermission')) || ['add_btn', 'edit_btn', 'admin-btn'])
|
|
159
|
-
sessionStorage.setItem('btnsPermission', JSON.stringify(btnsPermission.value))
|
|
160
|
-
// v-event 演示数据
|
|
161
|
-
const eventResult = ref('暂无点击')
|
|
162
|
-
|
|
163
|
-
// 综合演示数据
|
|
164
|
-
const username = ref('')
|
|
165
|
-
const age = ref('')
|
|
166
|
-
const description = ref('')
|
|
167
|
-
// 自动完成搜索函数
|
|
168
|
-
function querySearch(queryString: string, cb: (results: Array<{ value: string }>) => void) {
|
|
169
|
-
const results = queryString
|
|
170
|
-
? [
|
|
171
|
-
{ value: '测试用户1' },
|
|
172
|
-
{ value: '测试用户2' },
|
|
173
|
-
{ value: '管理员' },
|
|
174
|
-
{ value: '普通用户' },
|
|
175
|
-
{ value: '访客' }
|
|
176
|
-
].filter(item => item.value.includes(queryString))
|
|
177
|
-
: []
|
|
178
|
-
cb(results)
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// 权限切换函数 - 修复无限递归问题
|
|
182
|
-
function togglePermission() {
|
|
183
|
-
if (btnsPermission.value.includes('delete_btn')) {
|
|
184
|
-
// 移除权限
|
|
185
|
-
btnsPermission.value = btnsPermission.value.filter(item =>
|
|
186
|
-
!['delete_btn', 'save_btn', 'view_btn', 'export_btn', 'import_btn'].includes(item)
|
|
187
|
-
)
|
|
188
|
-
eventResult.value = '权限已移除,页面将在1秒后刷新以应用更改'
|
|
189
|
-
} else {
|
|
190
|
-
// 添加权限
|
|
191
|
-
const newPermissions = ['delete_btn', 'save_btn', 'view_btn', 'export_btn', 'import_btn']
|
|
192
|
-
newPermissions.forEach(permission => {
|
|
193
|
-
if (!btnsPermission.value.includes(permission)) {
|
|
194
|
-
btnsPermission.value.push(permission)
|
|
195
|
-
}
|
|
196
|
-
})
|
|
197
|
-
eventResult.value = '权限已添加,页面将在1秒后刷新以应用更改'
|
|
198
|
-
}
|
|
199
|
-
sessionStorage.setItem('btnsPermission', JSON.stringify(btnsPermission.value))
|
|
200
|
-
// 延迟刷新页面以应用权限变更
|
|
201
|
-
setTimeout(() => {
|
|
202
|
-
window.location.reload()
|
|
203
|
-
}, 1000)
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// 事件演示函数
|
|
207
|
-
function parentClick() {
|
|
208
|
-
eventResult.value = '父容器被点击了 - 这不应该发生,因为使用了v-event-unuse'
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
function childClick(event: Event) {
|
|
212
|
-
event.stopPropagation()
|
|
213
|
-
eventResult.value = '子容器被点击了 - v-event-use生效'
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// 清空表单
|
|
217
|
-
function clearForm() {
|
|
218
|
-
username.value = ''
|
|
219
|
-
age.value = ''
|
|
220
|
-
description.value = ''
|
|
221
|
-
basicInput.value = ''
|
|
222
|
-
nativeInput.value = ''
|
|
223
|
-
numberInput.value = ''
|
|
224
|
-
regexInput.value = ''
|
|
225
|
-
chineseInput.value = ''
|
|
226
|
-
autocompleteInput.value = ''
|
|
227
|
-
eventResult.value = '表单已清空'
|
|
228
|
-
}
|
|
229
|
-
</script>
|
|
230
|
-
<style scoped>
|
|
231
|
-
.demo-section {
|
|
232
|
-
margin-bottom: 40px;
|
|
233
|
-
padding: 20px;
|
|
234
|
-
border: 1px solid #e4e7ed;
|
|
235
|
-
border-radius: 8px;
|
|
236
|
-
background-color: #fafafa;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.demo-section h2 {
|
|
240
|
-
color: #409eff;
|
|
241
|
-
margin-bottom: 20px;
|
|
242
|
-
border-bottom: 2px solid #409eff;
|
|
243
|
-
padding-bottom: 10px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.demo-section h3 {
|
|
247
|
-
color: #606266;
|
|
248
|
-
margin: 20px 0 10px 0;
|
|
249
|
-
font-size: 16px;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.input-group {
|
|
253
|
-
display: flex;
|
|
254
|
-
align-items: center;
|
|
255
|
-
margin-bottom: 15px;
|
|
256
|
-
gap: 10px;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.input-group label {
|
|
260
|
-
min-width: 150px;
|
|
261
|
-
font-weight: 500;
|
|
262
|
-
color: #606266;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.input-group span {
|
|
266
|
-
color: #909399;
|
|
267
|
-
font-size: 14px;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.native-input {
|
|
271
|
-
width: 300px;
|
|
272
|
-
padding: 8px 12px;
|
|
273
|
-
border: 1px solid #dcdfe6;
|
|
274
|
-
border-radius: 4px;
|
|
275
|
-
font-size: 14px;
|
|
276
|
-
transition: border-color 0.2s;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.native-input:focus {
|
|
280
|
-
outline: none;
|
|
281
|
-
border-color: #409eff;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.button-group {
|
|
285
|
-
display: flex;
|
|
286
|
-
gap: 10px;
|
|
287
|
-
margin-bottom: 15px;
|
|
288
|
-
flex-wrap: wrap;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.event-demo-container {
|
|
292
|
-
border: 2px solid #f56c6c;
|
|
293
|
-
padding: 20px;
|
|
294
|
-
margin: 20px 0;
|
|
295
|
-
border-radius: 8px;
|
|
296
|
-
background-color: #fef0f0;
|
|
297
|
-
cursor: pointer;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.child-container {
|
|
301
|
-
border: 2px solid #67c23a;
|
|
302
|
-
padding: 15px;
|
|
303
|
-
margin: 10px 0;
|
|
304
|
-
border-radius: 6px;
|
|
305
|
-
background-color: #f0f9ff;
|
|
306
|
-
cursor: pointer;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.comprehensive-demo {
|
|
310
|
-
background-color: #fff;
|
|
311
|
-
padding: 20px;
|
|
312
|
-
border-radius: 8px;
|
|
313
|
-
border: 1px solid #e4e7ed;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.form-item {
|
|
317
|
-
display: flex;
|
|
318
|
-
align-items: center;
|
|
319
|
-
margin-bottom: 20px;
|
|
320
|
-
gap: 15px;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.form-item label {
|
|
324
|
-
min-width: 200px;
|
|
325
|
-
font-weight: 500;
|
|
326
|
-
color: #606266;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/* 响应式设计 */
|
|
330
|
-
@media (max-width: 768px) {
|
|
331
|
-
.input-group,
|
|
332
|
-
.form-item {
|
|
333
|
-
flex-direction: column;
|
|
334
|
-
align-items: flex-start;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.input-group label,
|
|
338
|
-
.form-item label {
|
|
339
|
-
min-width: auto;
|
|
340
|
-
margin-bottom: 5px;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.button-group {
|
|
344
|
-
flex-direction: column;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
</style>
|