@ebiz/designer-components 0.0.18-tj.1 → 0.0.19-beta.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/dist/designer-components.css +1 -1
- package/dist/index.mjs +66100 -52710
- package/package.json +1 -1
- package/src/apiService/mockDataService.js +116 -0
- package/src/apiService/simpleDataService.js +186 -80
- package/src/components/Button.vue +72 -22
- package/src/components/EbizAvatar.vue +116 -0
- package/src/components/EbizCheckbox.vue +94 -0
- package/src/components/EbizCheckboxGroup.vue +70 -0
- package/src/components/EbizDetailBlock.vue +82 -0
- package/src/components/EbizDialog.vue +249 -0
- package/src/components/EbizEmployeeInfo.vue +139 -0
- package/src/components/EbizPageHeader.vue +96 -0
- package/src/components/EbizPagination.vue +163 -0
- package/src/components/EbizRadio.vue +87 -0
- package/src/components/EbizRadioGroup.vue +84 -0
- package/src/components/EbizRemoteSelect.vue +107 -41
- package/src/components/EbizStatistic.vue +150 -0
- package/src/components/EbizSwiper.vue +3 -3
- package/src/components/EbizSwitch.vue +86 -0
- package/src/components/EbizTabHeader.vue +6 -10
- package/src/components/EbizTabPanel.vue +23 -0
- package/src/components/EbizTable.vue +466 -0
- package/src/components/EbizTableColumn.vue +117 -0
- package/src/components/EbizTableSort.vue +181 -0
- package/src/components/EbizTabs.vue +143 -0
- package/src/components/EbizTimePicker.vue +144 -0
- package/src/components/EbizTitle.vue +36 -37
- package/src/components/EbizTree.vue +153 -0
- package/src/components/EbizTreeSelector.vue +418 -0
- package/src/components/TdesignAlert.vue +116 -0
- package/src/components/TdesignCalendar/index.vue +6 -3
- package/src/components/TdesignCol.vue +102 -0
- package/src/components/TdesignDialog.vue +226 -0
- package/src/components/TdesignGrid.vue +56 -0
- package/src/components/TdesignInput.vue +23 -23
- package/src/components/TdesignTextarea.vue +143 -0
- package/src/components/TdesignTimeline.vue +58 -0
- package/src/components/TdesignTimelineItem.vue +72 -0
- package/src/components/TdesignUpload.vue +757 -0
- package/src/components/TdesignWatermark.vue +108 -0
- package/src/index.js +85 -0
- package/src/main.js +2 -2
- package/src/router/index.js +160 -5
- package/src/views/Button.vue +7 -3
- package/src/views/CheckboxDemo.vue +105 -0
- package/src/views/DialogDemo.vue +126 -0
- package/src/views/EbizAvatar.vue +224 -0
- package/src/views/EbizDetailBlockDemo.vue +31 -0
- package/src/views/EbizEmployeeInfo.vue +250 -0
- package/src/views/EbizRadioDemo.vue +152 -0
- package/src/views/GridDemo.vue +239 -0
- package/src/views/Home.vue +49 -2
- package/src/views/PageHeaderDemo.vue +105 -0
- package/src/views/PaginationDemo.vue +97 -0
- package/src/views/RemoteSelect.vue +336 -5
- package/src/views/StatisticDemo.vue +191 -0
- package/src/views/SwitchDemo.vue +80 -0
- package/src/views/TableDemo.vue +335 -0
- package/src/views/TableSortDemo.vue +144 -0
- package/src/views/TableView.vue +69 -0
- package/src/views/TabsDemo.vue +283 -0
- package/src/views/TdesignAlert.vue +99 -0
- package/src/views/TextareaDemo.vue +94 -0
- package/src/views/TimePickerDemo.vue +147 -0
- package/src/views/TimelineDemo.vue +161 -0
- package/src/views/TreeDemo.vue +255 -0
- package/src/views/TreeSelectorDemo.vue +246 -0
- package/src/views/UploadDemo.vue +122 -0
- package/src/views/WatermarkDemo.vue +86 -0
@@ -0,0 +1,283 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="tabs-demo">
|
3
|
+
<h1>TDesign Tabs 组件示例</h1>
|
4
|
+
|
5
|
+
<h2>原生TDesign选项卡</h2>
|
6
|
+
<div class="demo-section">
|
7
|
+
<t-tabs :default-value="1">
|
8
|
+
<t-tab-panel :value="1" label="选项卡1">
|
9
|
+
<p style="margin: 20px">选项卡1内容区</p>
|
10
|
+
</t-tab-panel>
|
11
|
+
<t-tab-panel :value="2" label="选项卡2">
|
12
|
+
<p style="margin: 20px">选项卡2内容区</p>
|
13
|
+
</t-tab-panel>
|
14
|
+
<t-tab-panel :value="3" label="选项卡3">
|
15
|
+
<p style="margin: 20px">选项卡3内容区</p>
|
16
|
+
</t-tab-panel>
|
17
|
+
</t-tabs>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<h2>基础选项卡</h2>
|
21
|
+
<div class="demo-section">
|
22
|
+
<EbizTabs v-model="activeTab">
|
23
|
+
<EbizTabPanel value="first" label="选项卡1">
|
24
|
+
选项卡1内容区
|
25
|
+
</EbizTabPanel>
|
26
|
+
<EbizTabPanel value="second" label="选项卡2">
|
27
|
+
选项卡2内容区
|
28
|
+
</EbizTabPanel>
|
29
|
+
<EbizTabPanel value="third" label="选项卡3">
|
30
|
+
选项卡3内容区
|
31
|
+
</EbizTabPanel>
|
32
|
+
</EbizTabs>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<h2>不同位置的选项卡</h2>
|
36
|
+
<div class="demo-section">
|
37
|
+
<div class="placement-demo">
|
38
|
+
<h3>顶部选项卡</h3>
|
39
|
+
<EbizTabs placement="top">
|
40
|
+
<EbizTabPanel value="first" label="选项卡1">
|
41
|
+
顶部选项卡内容
|
42
|
+
</EbizTabPanel>
|
43
|
+
<EbizTabPanel value="second" label="选项卡2">
|
44
|
+
顶部选项卡内容
|
45
|
+
</EbizTabPanel>
|
46
|
+
</EbizTabs>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div class="placement-demo">
|
50
|
+
<h3>左侧选项卡</h3>
|
51
|
+
<EbizTabs placement="left">
|
52
|
+
<EbizTabPanel value="first" label="选项卡1">
|
53
|
+
左侧选项卡内容
|
54
|
+
</EbizTabPanel>
|
55
|
+
<EbizTabPanel value="second" label="选项卡2">
|
56
|
+
左侧选项卡内容
|
57
|
+
</EbizTabPanel>
|
58
|
+
</EbizTabs>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div class="placement-demo">
|
62
|
+
<h3>右侧选项卡</h3>
|
63
|
+
<EbizTabs placement="right">
|
64
|
+
<EbizTabPanel value="first" label="选项卡1">
|
65
|
+
右侧选项卡内容
|
66
|
+
</EbizTabPanel>
|
67
|
+
<EbizTabPanel value="second" label="选项卡2">
|
68
|
+
右侧选项卡内容
|
69
|
+
</EbizTabPanel>
|
70
|
+
</EbizTabs>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<div class="placement-demo">
|
74
|
+
<h3>底部选项卡</h3>
|
75
|
+
<EbizTabs placement="bottom">
|
76
|
+
<EbizTabPanel value="first" label="选项卡1">
|
77
|
+
底部选项卡内容
|
78
|
+
</EbizTabPanel>
|
79
|
+
<EbizTabPanel value="second" label="选项卡2">
|
80
|
+
底部选项卡内容
|
81
|
+
</EbizTabPanel>
|
82
|
+
</EbizTabs>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
<h2>卡片风格选项卡</h2>
|
87
|
+
<div class="demo-section">
|
88
|
+
<EbizTabs theme="card">
|
89
|
+
<EbizTabPanel value="first" label="选项卡1">
|
90
|
+
卡片风格选项卡内容
|
91
|
+
</EbizTabPanel>
|
92
|
+
<EbizTabPanel value="second" label="选项卡2">
|
93
|
+
卡片风格选项卡内容
|
94
|
+
</EbizTabPanel>
|
95
|
+
<EbizTabPanel value="third" label="选项卡3">
|
96
|
+
卡片风格选项卡内容
|
97
|
+
</EbizTabPanel>
|
98
|
+
</EbizTabs>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
<h2>尺寸大小</h2>
|
102
|
+
<div class="demo-section">
|
103
|
+
<div class="size-demo">
|
104
|
+
<h3>中尺寸(默认)</h3>
|
105
|
+
<EbizTabs size="medium">
|
106
|
+
<EbizTabPanel value="first" label="选项卡1">
|
107
|
+
中尺寸选项卡内容
|
108
|
+
</EbizTabPanel>
|
109
|
+
<EbizTabPanel value="second" label="选项卡2">
|
110
|
+
中尺寸选项卡内容
|
111
|
+
</EbizTabPanel>
|
112
|
+
</EbizTabs>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="size-demo">
|
116
|
+
<h3>大尺寸</h3>
|
117
|
+
<EbizTabs size="large">
|
118
|
+
<EbizTabPanel value="first" label="选项卡1">
|
119
|
+
大尺寸选项卡内容
|
120
|
+
</EbizTabPanel>
|
121
|
+
<EbizTabPanel value="second" label="选项卡2">
|
122
|
+
大尺寸选项卡内容
|
123
|
+
</EbizTabPanel>
|
124
|
+
</EbizTabs>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<h2>可增加的选项卡</h2>
|
129
|
+
<div class="demo-section">
|
130
|
+
<EbizTabs v-model="addableActiveTab" addable @add="onAddTab">
|
131
|
+
<EbizTabPanel
|
132
|
+
v-for="(item, index) in addableTabs"
|
133
|
+
:key="item.value"
|
134
|
+
:value="item.value"
|
135
|
+
:label="item.label"
|
136
|
+
:removable="index !== 0"
|
137
|
+
@remove="onRemoveTab(item)"
|
138
|
+
>
|
139
|
+
{{ item.content }}
|
140
|
+
</EbizTabPanel>
|
141
|
+
</EbizTabs>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<h2>可拖拽排序的选项卡</h2>
|
145
|
+
<div class="demo-section">
|
146
|
+
<EbizTabs v-model="dragSortTab" dragSort @dragSort="onDragSort">
|
147
|
+
<EbizTabPanel
|
148
|
+
v-for="item in dragSortTabs"
|
149
|
+
:key="item.value"
|
150
|
+
:value="item.value"
|
151
|
+
:label="item.label"
|
152
|
+
>
|
153
|
+
{{ item.content }}
|
154
|
+
</EbizTabPanel>
|
155
|
+
</EbizTabs>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<h2>禁用状态</h2>
|
159
|
+
<div class="demo-section">
|
160
|
+
<EbizTabs>
|
161
|
+
<EbizTabPanel value="first" label="选项卡1">
|
162
|
+
选项卡1内容
|
163
|
+
</EbizTabPanel>
|
164
|
+
<EbizTabPanel value="second" label="选项卡2" disabled>
|
165
|
+
选项卡2内容(禁用状态)
|
166
|
+
</EbizTabPanel>
|
167
|
+
<EbizTabPanel value="third" label="选项卡3">
|
168
|
+
选项卡3内容
|
169
|
+
</EbizTabPanel>
|
170
|
+
</EbizTabs>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
</template>
|
174
|
+
|
175
|
+
<script setup>
|
176
|
+
import { ref, onMounted } from 'vue';
|
177
|
+
import { EbizTabs, EbizTabPanel } from '../index.js';
|
178
|
+
import { TabPanel } from 'tdesign-vue-next';
|
179
|
+
|
180
|
+
// 基础选项卡
|
181
|
+
const activeTab = ref('first');
|
182
|
+
|
183
|
+
// 可增加选项卡
|
184
|
+
const addableTabIndex = ref(3);
|
185
|
+
const addableActiveTab = ref('tab0');
|
186
|
+
const addableTabs = ref([
|
187
|
+
{
|
188
|
+
value: 'tab0',
|
189
|
+
label: '首页',
|
190
|
+
content: '首页内容'
|
191
|
+
},
|
192
|
+
{
|
193
|
+
value: 'tab1',
|
194
|
+
label: '选项卡1',
|
195
|
+
content: '选项卡1内容'
|
196
|
+
},
|
197
|
+
{
|
198
|
+
value: 'tab2',
|
199
|
+
label: '选项卡2',
|
200
|
+
content: '选项卡2内容'
|
201
|
+
}
|
202
|
+
]);
|
203
|
+
|
204
|
+
// 可拖拽排序选项卡
|
205
|
+
const dragSortTab = ref('drag0');
|
206
|
+
const dragSortTabs = ref([
|
207
|
+
{
|
208
|
+
value: 'drag0',
|
209
|
+
label: '选项1',
|
210
|
+
content: '选项1内容'
|
211
|
+
},
|
212
|
+
{
|
213
|
+
value: 'drag1',
|
214
|
+
label: '选项2',
|
215
|
+
content: '选项2内容'
|
216
|
+
},
|
217
|
+
{
|
218
|
+
value: 'drag2',
|
219
|
+
label: '选项3',
|
220
|
+
content: '选项3内容'
|
221
|
+
}
|
222
|
+
]);
|
223
|
+
|
224
|
+
// 添加选项卡
|
225
|
+
const onAddTab = () => {
|
226
|
+
const value = `tab${addableTabIndex.value}`;
|
227
|
+
addableTabs.value.push({
|
228
|
+
value,
|
229
|
+
label: `选项卡${addableTabIndex.value}`,
|
230
|
+
content: `选项卡${addableTabIndex.value}内容`
|
231
|
+
});
|
232
|
+
addableActiveTab.value = value;
|
233
|
+
addableTabIndex.value += 1;
|
234
|
+
};
|
235
|
+
|
236
|
+
// 删除选项卡
|
237
|
+
const onRemoveTab = (item) => {
|
238
|
+
const index = addableTabs.value.findIndex((tab) => tab.value === item.value);
|
239
|
+
if (index !== -1) {
|
240
|
+
addableTabs.value.splice(index, 1);
|
241
|
+
}
|
242
|
+
};
|
243
|
+
|
244
|
+
// 处理拖拽排序
|
245
|
+
const onDragSort = (context) => {
|
246
|
+
// 根据拖拽结果重新排序
|
247
|
+
dragSortTabs.value = context.currentData;
|
248
|
+
};
|
249
|
+
|
250
|
+
// 检查tdesign-vue-next依赖是否已正确安装
|
251
|
+
onMounted(() => {
|
252
|
+
console.log('TabsDemo mounted');
|
253
|
+
});
|
254
|
+
</script>
|
255
|
+
|
256
|
+
<style lang="less" scoped>
|
257
|
+
.tabs-demo {
|
258
|
+
padding: 20px;
|
259
|
+
|
260
|
+
.demo-section {
|
261
|
+
margin-bottom: 30px;
|
262
|
+
}
|
263
|
+
|
264
|
+
.placement-demo, .size-demo {
|
265
|
+
margin-bottom: 20px;
|
266
|
+
}
|
267
|
+
|
268
|
+
h1 {
|
269
|
+
font-size: 24px;
|
270
|
+
margin-bottom: 20px;
|
271
|
+
}
|
272
|
+
|
273
|
+
h2 {
|
274
|
+
font-size: 20px;
|
275
|
+
margin: 30px 0 15px;
|
276
|
+
}
|
277
|
+
|
278
|
+
h3 {
|
279
|
+
font-size: 16px;
|
280
|
+
margin-bottom: 10px;
|
281
|
+
}
|
282
|
+
}
|
283
|
+
</style>
|
@@ -0,0 +1,99 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="alert-demo">
|
3
|
+
<h1>TDesign Alert 组件示例</h1>
|
4
|
+
|
5
|
+
<h2>基础提示</h2>
|
6
|
+
<div class="demo-section">
|
7
|
+
<EbizAlert message="这是一条普通信息提示" />
|
8
|
+
<EbizAlert theme="success" message="这是一条成功提示" />
|
9
|
+
<EbizAlert theme="warning" message="这是一条警告提示" />
|
10
|
+
<EbizAlert theme="error" message="这是一条错误提示" />
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<h2>带标题的提示</h2>
|
14
|
+
<div class="demo-section">
|
15
|
+
<EbizAlert title="信息提示标题" message="这是一条普通信息提示" />
|
16
|
+
<EbizAlert theme="success" title="成功提示标题" message="这是一条成功提示" />
|
17
|
+
<EbizAlert theme="warning" title="警告提示标题" message="这是一条警告提示" />
|
18
|
+
<EbizAlert theme="error" title="错误提示标题" message="这是一条错误提示" />
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<h2>带描述的提示</h2>
|
22
|
+
<div class="demo-section">
|
23
|
+
<EbizAlert
|
24
|
+
title="信息提示"
|
25
|
+
message="这是一条普通信息提示"
|
26
|
+
description="这是一段描述文字,用于进一步解释说明提示内容"
|
27
|
+
/>
|
28
|
+
<EbizAlert
|
29
|
+
theme="success"
|
30
|
+
title="成功提示"
|
31
|
+
message="这是一条成功提示"
|
32
|
+
description="这是一段描述文字,用于进一步解释说明提示内容"
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<h2>可关闭的提示</h2>
|
37
|
+
<div class="demo-section">
|
38
|
+
<EbizAlert message="可关闭的信息提示" close @close="handleClose" />
|
39
|
+
<EbizAlert
|
40
|
+
theme="success"
|
41
|
+
title="可关闭的成功提示"
|
42
|
+
message="这是一条成功提示"
|
43
|
+
close
|
44
|
+
@close="handleClose"
|
45
|
+
/>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<h2>带操作的提示</h2>
|
49
|
+
<div class="demo-section">
|
50
|
+
<EbizAlert
|
51
|
+
message="带操作按钮的提示"
|
52
|
+
operation="查看详情"
|
53
|
+
/>
|
54
|
+
<EbizAlert
|
55
|
+
theme="warning"
|
56
|
+
title="带操作按钮的警告"
|
57
|
+
message="这是一条警告提示"
|
58
|
+
>
|
59
|
+
<template #operation>
|
60
|
+
<t-button theme="warning" variant="text" size="small">查看详情</t-button>
|
61
|
+
</template>
|
62
|
+
</EbizAlert>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<h2>自定义图标</h2>
|
66
|
+
<div class="demo-section">
|
67
|
+
<EbizAlert message="自定义图标提示" theme="success">
|
68
|
+
<template #icon>
|
69
|
+
<t-icon name="check-circle-filled" />
|
70
|
+
</template>
|
71
|
+
</EbizAlert>
|
72
|
+
<EbizAlert message="无图标提示" :icon="false" />
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
</template>
|
76
|
+
|
77
|
+
<script setup>
|
78
|
+
import { EbizAlert } from '../index.js';
|
79
|
+
import { Button as TButton, Icon as TIcon } from 'tdesign-vue-next';
|
80
|
+
import { ref } from 'vue';
|
81
|
+
|
82
|
+
const handleClose = (e) => {
|
83
|
+
console.log('Alert closed', e);
|
84
|
+
};
|
85
|
+
</script>
|
86
|
+
|
87
|
+
<style lang="less" scoped>
|
88
|
+
.alert-demo {
|
89
|
+
padding: 20px;
|
90
|
+
}
|
91
|
+
|
92
|
+
.demo-section {
|
93
|
+
margin-bottom: 24px;
|
94
|
+
|
95
|
+
.t-alert {
|
96
|
+
margin-bottom: 16px;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
</style>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="textarea-demo">
|
3
|
+
<h1>Textarea 多行文本框</h1>
|
4
|
+
|
5
|
+
<section>
|
6
|
+
<h2>基础多行文本框</h2>
|
7
|
+
<p>用于多行文本的输入。</p>
|
8
|
+
<div class="demo-item">
|
9
|
+
<ebiz-textarea placeholder="请输入多行文本"></ebiz-textarea>
|
10
|
+
</div>
|
11
|
+
</section>
|
12
|
+
|
13
|
+
<section>
|
14
|
+
<h2>限制最大字符数</h2>
|
15
|
+
<p>限制输入的最大字符数并展示字符数。</p>
|
16
|
+
<div class="demo-item">
|
17
|
+
<ebiz-textarea placeholder="请输入" :max-length="20" :max-character="true"></ebiz-textarea>
|
18
|
+
</div>
|
19
|
+
</section>
|
20
|
+
|
21
|
+
<section>
|
22
|
+
<h2>自动调整高度</h2>
|
23
|
+
<p>根据内容自动调整输入框的高度。</p>
|
24
|
+
<div class="demo-item">
|
25
|
+
<ebiz-textarea placeholder="请输入" :autosize="true"></ebiz-textarea>
|
26
|
+
</div>
|
27
|
+
</section>
|
28
|
+
|
29
|
+
<section>
|
30
|
+
<h2>不同状态的多行文本框</h2>
|
31
|
+
<p>支持只读、禁用和不同的状态样式。</p>
|
32
|
+
<div class="demo-item">
|
33
|
+
<p>默认状态:</p>
|
34
|
+
<ebiz-textarea placeholder="默认状态" tips="这是默认提示文本"></ebiz-textarea>
|
35
|
+
</div>
|
36
|
+
<div class="demo-item">
|
37
|
+
<p>成功状态:</p>
|
38
|
+
<ebiz-textarea placeholder="成功状态" status="success" tips="校验通过文本提示"></ebiz-textarea>
|
39
|
+
</div>
|
40
|
+
<div class="demo-item">
|
41
|
+
<p>警告状态:</p>
|
42
|
+
<ebiz-textarea placeholder="警告状态" status="warning" tips="校验存在警告文本提示"></ebiz-textarea>
|
43
|
+
</div>
|
44
|
+
<div class="demo-item">
|
45
|
+
<p>错误状态:</p>
|
46
|
+
<ebiz-textarea placeholder="错误状态" status="error" tips="校验不通过文本提示"></ebiz-textarea>
|
47
|
+
</div>
|
48
|
+
<div class="demo-item">
|
49
|
+
<p>只读状态:</p>
|
50
|
+
<ebiz-textarea placeholder="只读状态" :readonly="true" value="这是只读文本"></ebiz-textarea>
|
51
|
+
</div>
|
52
|
+
<div class="demo-item">
|
53
|
+
<p>禁用状态:</p>
|
54
|
+
<ebiz-textarea placeholder="禁用状态" :disabled="true"></ebiz-textarea>
|
55
|
+
</div>
|
56
|
+
</section>
|
57
|
+
</div>
|
58
|
+
</template>
|
59
|
+
|
60
|
+
<script setup>
|
61
|
+
import { EbizTextarea } from '../index.js';
|
62
|
+
</script>
|
63
|
+
|
64
|
+
<style scoped>
|
65
|
+
.textarea-demo {
|
66
|
+
max-width: 800px;
|
67
|
+
margin: 0 auto;
|
68
|
+
padding: 20px;
|
69
|
+
}
|
70
|
+
|
71
|
+
h1 {
|
72
|
+
font-size: 28px;
|
73
|
+
margin-bottom: 24px;
|
74
|
+
}
|
75
|
+
|
76
|
+
h2 {
|
77
|
+
font-size: 20px;
|
78
|
+
margin-top: 32px;
|
79
|
+
margin-bottom: 16px;
|
80
|
+
}
|
81
|
+
|
82
|
+
section {
|
83
|
+
margin-bottom: 40px;
|
84
|
+
}
|
85
|
+
|
86
|
+
.demo-item {
|
87
|
+
margin-bottom: 16px;
|
88
|
+
max-width: 400px;
|
89
|
+
}
|
90
|
+
|
91
|
+
p {
|
92
|
+
margin-bottom: 8px;
|
93
|
+
}
|
94
|
+
</style>
|
@@ -0,0 +1,147 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="time-picker-demo">
|
3
|
+
<h2>时间选择器 EbizTimePicker</h2>
|
4
|
+
|
5
|
+
<h3>基本用法</h3>
|
6
|
+
<div class="demo-section">
|
7
|
+
<EbizTimePicker v-model="value1" placeholder="请选择时间" />
|
8
|
+
<div class="demo-value">选中值: {{ value1 }}</div>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<h3>时间格式</h3>
|
12
|
+
<div class="demo-section">
|
13
|
+
<EbizTimePicker v-model="value2" format="HH:mm" placeholder="时分格式 HH:mm" />
|
14
|
+
<div class="demo-value">选中值: {{ value2 }}</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<h3>禁用状态</h3>
|
18
|
+
<div class="demo-section">
|
19
|
+
<EbizTimePicker v-model="value3" disabled placeholder="禁用状态" />
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<h3>时间范围选择</h3>
|
23
|
+
<div class="demo-section">
|
24
|
+
<EbizTimePicker v-model="value4" range placeholder="请选择时间范围" />
|
25
|
+
<div class="demo-value">选中值: {{ value4 }}</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<h3>步长设置</h3>
|
29
|
+
<div class="demo-section">
|
30
|
+
<EbizTimePicker v-model="value5" :steps="[2, 10, 15]" placeholder="步长:时(2) 分(10) 秒(15)" />
|
31
|
+
<div class="demo-value">选中值: {{ value5 }}</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<h3>禁用时间</h3>
|
35
|
+
<div class="demo-section">
|
36
|
+
<EbizTimePicker v-model="value6" :disable-time="disableTime" placeholder="上午禁用" />
|
37
|
+
<div class="demo-value">选中值: {{ value6 }}</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<h3>不同尺寸</h3>
|
41
|
+
<div class="demo-section">
|
42
|
+
<div class="size-row">
|
43
|
+
<EbizTimePicker v-model="value7" size="small" placeholder="小尺寸" />
|
44
|
+
<EbizTimePicker v-model="value7" size="medium" placeholder="中尺寸(默认)" />
|
45
|
+
<EbizTimePicker v-model="value7" size="large" placeholder="大尺寸" />
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<h3>提示信息</h3>
|
50
|
+
<div class="demo-section">
|
51
|
+
<EbizTimePicker v-model="value8" tips="这是一个提示文本" placeholder="带提示信息" />
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<h3>前置/后置插槽</h3>
|
55
|
+
<div class="demo-section">
|
56
|
+
<EbizTimePicker v-model="value9" placeholder="带前置内容">
|
57
|
+
<template #prepend>
|
58
|
+
<span class="prepend-content">时间:</span>
|
59
|
+
</template>
|
60
|
+
</EbizTimePicker>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</template>
|
64
|
+
|
65
|
+
<script setup>
|
66
|
+
import { ref } from 'vue';
|
67
|
+
import { EbizTimePicker } from '../index.js';
|
68
|
+
|
69
|
+
// 基本用法
|
70
|
+
const value1 = ref('');
|
71
|
+
|
72
|
+
// 时间格式
|
73
|
+
const value2 = ref('');
|
74
|
+
|
75
|
+
// 禁用状态
|
76
|
+
const value3 = ref('12:30:00');
|
77
|
+
|
78
|
+
// 时间范围选择
|
79
|
+
const value4 = ref(['09:00:00', '18:00:00']);
|
80
|
+
|
81
|
+
// 步长设置
|
82
|
+
const value5 = ref('');
|
83
|
+
|
84
|
+
// 禁用时间
|
85
|
+
const value6 = ref('');
|
86
|
+
const disableTime = (h) => {
|
87
|
+
// 禁用上午时间段 (0-12点)
|
88
|
+
return h < 12;
|
89
|
+
};
|
90
|
+
|
91
|
+
// 不同尺寸
|
92
|
+
const value7 = ref('');
|
93
|
+
|
94
|
+
// 提示信息
|
95
|
+
const value8 = ref('');
|
96
|
+
|
97
|
+
// 前置/后置插槽
|
98
|
+
const value9 = ref('');
|
99
|
+
</script>
|
100
|
+
|
101
|
+
<style scoped>
|
102
|
+
.time-picker-demo {
|
103
|
+
padding: 20px;
|
104
|
+
max-width: 800px;
|
105
|
+
margin: 0 auto;
|
106
|
+
}
|
107
|
+
|
108
|
+
h2 {
|
109
|
+
margin-bottom: 30px;
|
110
|
+
font-weight: 500;
|
111
|
+
border-bottom: 1px solid #eee;
|
112
|
+
padding-bottom: 10px;
|
113
|
+
}
|
114
|
+
|
115
|
+
h3 {
|
116
|
+
margin-top: 30px;
|
117
|
+
margin-bottom: 15px;
|
118
|
+
font-weight: 400;
|
119
|
+
font-size: 18px;
|
120
|
+
color: #333;
|
121
|
+
}
|
122
|
+
|
123
|
+
.demo-section {
|
124
|
+
margin-bottom: 30px;
|
125
|
+
padding: 20px;
|
126
|
+
background-color: #f9f9f9;
|
127
|
+
border-radius: 4px;
|
128
|
+
}
|
129
|
+
|
130
|
+
.demo-value {
|
131
|
+
margin-top: 10px;
|
132
|
+
color: #606060;
|
133
|
+
font-size: 14px;
|
134
|
+
padding: 5px 0;
|
135
|
+
}
|
136
|
+
|
137
|
+
.size-row {
|
138
|
+
display: flex;
|
139
|
+
gap: 20px;
|
140
|
+
align-items: center;
|
141
|
+
}
|
142
|
+
|
143
|
+
.prepend-content {
|
144
|
+
padding: 0 10px;
|
145
|
+
color: #0052D9;
|
146
|
+
}
|
147
|
+
</style>
|