@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,224 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="container">
|
3
|
+
<h1>EbizAvatar 头像组件示例</h1>
|
4
|
+
|
5
|
+
<div class="section">
|
6
|
+
<h2>基础用法</h2>
|
7
|
+
<div class="example-block">
|
8
|
+
<ebiz-avatar content="用户" />
|
9
|
+
</div>
|
10
|
+
<div class="code-block">
|
11
|
+
<pre><code><ebiz-avatar content="用户" /></code></pre>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="section">
|
16
|
+
<h2>不同形状</h2>
|
17
|
+
<div class="example-block avatar-shape-container">
|
18
|
+
<div v-for="shape in shapeList" :key="shape" class="avatar-shape-item">
|
19
|
+
<ebiz-avatar
|
20
|
+
content="用户"
|
21
|
+
:shape="shape"
|
22
|
+
/>
|
23
|
+
<div class="avatar-shape-text">shape: {{ shape }}</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div class="code-block">
|
27
|
+
<pre><code>// 可选值: circle(默认), round
|
28
|
+
<ebiz-avatar
|
29
|
+
content="用户"
|
30
|
+
shape="round"
|
31
|
+
/></code></pre>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div class="section">
|
36
|
+
<h2>不同尺寸</h2>
|
37
|
+
<div class="example-block avatar-size-container">
|
38
|
+
<div v-for="size in sizeList" :key="size" class="avatar-size-item">
|
39
|
+
<ebiz-avatar
|
40
|
+
content="用户"
|
41
|
+
:size="size"
|
42
|
+
/>
|
43
|
+
<div class="avatar-size-text">size: {{ size }}</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<div class="code-block">
|
47
|
+
<pre><code>// 可选值: small, medium(默认), large
|
48
|
+
<ebiz-avatar
|
49
|
+
content="用户"
|
50
|
+
size="large"
|
51
|
+
/></code></pre>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div class="section">
|
56
|
+
<h2>图片头像</h2>
|
57
|
+
<div class="example-block">
|
58
|
+
<ebiz-avatar
|
59
|
+
image="https://tdesign.tencent.com/vue-next/assets/image1.jpg"
|
60
|
+
alt="用户头像"
|
61
|
+
/>
|
62
|
+
</div>
|
63
|
+
<div class="code-block">
|
64
|
+
<pre><code><ebiz-avatar
|
65
|
+
image="https://tdesign.tencent.com/vue-next/assets/image1.jpg"
|
66
|
+
alt="用户头像"
|
67
|
+
/></code></pre>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
<div class="section">
|
72
|
+
<h2>自定义尺寸</h2>
|
73
|
+
<div class="example-block">
|
74
|
+
<ebiz-avatar
|
75
|
+
content="用户"
|
76
|
+
width="100px"
|
77
|
+
height="100px"
|
78
|
+
/>
|
79
|
+
</div>
|
80
|
+
<div class="code-block">
|
81
|
+
<pre><code><ebiz-avatar
|
82
|
+
content="用户"
|
83
|
+
width="100px"
|
84
|
+
height="100px"
|
85
|
+
/></code></pre>
|
86
|
+
</div>
|
87
|
+
</div>
|
88
|
+
|
89
|
+
<div class="section">
|
90
|
+
<h2>带徽标的头像</h2>
|
91
|
+
<div class="example-block">
|
92
|
+
<ebiz-avatar
|
93
|
+
content="用户"
|
94
|
+
:badge-props="{ count: 5 }"
|
95
|
+
/>
|
96
|
+
</div>
|
97
|
+
<div class="code-block">
|
98
|
+
<pre><code><ebiz-avatar
|
99
|
+
content="用户"
|
100
|
+
:badge-props="{ count: 5 }"
|
101
|
+
/></code></pre>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<div class="section">
|
106
|
+
<h2>图标头像</h2>
|
107
|
+
<div class="example-block">
|
108
|
+
<ebiz-avatar>
|
109
|
+
<template #icon>
|
110
|
+
<t-icon name="user" />
|
111
|
+
</template>
|
112
|
+
</ebiz-avatar>
|
113
|
+
</div>
|
114
|
+
<div class="code-block">
|
115
|
+
<pre><code><ebiz-avatar>
|
116
|
+
<template #icon>
|
117
|
+
<t-icon name="user" />
|
118
|
+
</template>
|
119
|
+
</ebiz-avatar></code></pre>
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="section">
|
124
|
+
<h2>图片加载失败处理</h2>
|
125
|
+
<div class="example-block">
|
126
|
+
<ebiz-avatar
|
127
|
+
image="https://non-existent-image.jpg"
|
128
|
+
content="用户"
|
129
|
+
:hide-on-load-error="false"
|
130
|
+
@error="handleError"
|
131
|
+
/>
|
132
|
+
</div>
|
133
|
+
<div class="code-block">
|
134
|
+
<pre><code><ebiz-avatar
|
135
|
+
image="https://non-existent-image.jpg"
|
136
|
+
content="用户"
|
137
|
+
:hide-on-load-error="false"
|
138
|
+
@error="handleError"
|
139
|
+
/></code></pre>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
</template>
|
144
|
+
|
145
|
+
<script>
|
146
|
+
import { EbizAvatar } from '../index.js'
|
147
|
+
import { Icon as TIcon } from 'tdesign-vue-next'
|
148
|
+
|
149
|
+
export default {
|
150
|
+
name: 'EbizAvatarDemo',
|
151
|
+
components: {
|
152
|
+
EbizAvatar,
|
153
|
+
TIcon
|
154
|
+
},
|
155
|
+
data() {
|
156
|
+
return {
|
157
|
+
shapeList: ['circle', 'round'],
|
158
|
+
sizeList: ['small', 'medium', 'large']
|
159
|
+
}
|
160
|
+
},
|
161
|
+
methods: {
|
162
|
+
handleError(context) {
|
163
|
+
console.log('图片加载失败', context)
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
</script>
|
168
|
+
|
169
|
+
<style lang="less" scoped>
|
170
|
+
.container {
|
171
|
+
padding: 20px;
|
172
|
+
|
173
|
+
h1 {
|
174
|
+
margin-bottom: 20px;
|
175
|
+
}
|
176
|
+
|
177
|
+
.section {
|
178
|
+
margin-bottom: 30px;
|
179
|
+
|
180
|
+
h2 {
|
181
|
+
margin-bottom: 15px;
|
182
|
+
}
|
183
|
+
|
184
|
+
.example-block {
|
185
|
+
margin-bottom: 15px;
|
186
|
+
padding: 20px;
|
187
|
+
border: 1px solid #eee;
|
188
|
+
border-radius: 4px;
|
189
|
+
}
|
190
|
+
|
191
|
+
.code-block {
|
192
|
+
background-color: #f5f5f5;
|
193
|
+
padding: 15px;
|
194
|
+
border-radius: 4px;
|
195
|
+
|
196
|
+
pre {
|
197
|
+
margin: 0;
|
198
|
+
white-space: pre-wrap;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
.avatar-shape-container,
|
204
|
+
.avatar-size-container {
|
205
|
+
display: flex;
|
206
|
+
flex-wrap: wrap;
|
207
|
+
gap: 20px;
|
208
|
+
}
|
209
|
+
|
210
|
+
.avatar-shape-item,
|
211
|
+
.avatar-size-item {
|
212
|
+
display: flex;
|
213
|
+
flex-direction: column;
|
214
|
+
align-items: center;
|
215
|
+
}
|
216
|
+
|
217
|
+
.avatar-shape-text,
|
218
|
+
.avatar-size-text {
|
219
|
+
margin-top: 10px;
|
220
|
+
font-size: 14px;
|
221
|
+
color: #666;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
</style>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<ebiz-route-breadcrumb />
|
4
|
+
<ebiz-detail-block :model="model" :labelMap="labelMap" :gap="10" :labelSize="20" :labelColor="'#000'" :valueSize="20" :valueColor="'#000'"/>
|
5
|
+
</div>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
import { EbizDetailBlock } from '@/index.js'
|
10
|
+
|
11
|
+
export default {
|
12
|
+
name: 'EbizDetailBlockDemo',
|
13
|
+
components: {
|
14
|
+
EbizDetailBlock
|
15
|
+
},
|
16
|
+
data() {
|
17
|
+
return {
|
18
|
+
model: {
|
19
|
+
"name": "张三",
|
20
|
+
"sex": "男"
|
21
|
+
},
|
22
|
+
labelMap:{
|
23
|
+
"name": "姓名",
|
24
|
+
"sex": "性别"
|
25
|
+
}
|
26
|
+
}
|
27
|
+
},
|
28
|
+
}
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<style scoped></style>
|
@@ -0,0 +1,250 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="container">
|
3
|
+
<h1>EbizEmployeeInfo 员工信息组件示例</h1>
|
4
|
+
|
5
|
+
<div class="section">
|
6
|
+
<h2>基础用法</h2>
|
7
|
+
<div class="example-block">
|
8
|
+
<ebiz-employee-info
|
9
|
+
:info="basicEmployee"
|
10
|
+
/>
|
11
|
+
</div>
|
12
|
+
<div class="code-block">
|
13
|
+
<pre><code><ebiz-employee-info
|
14
|
+
:info="{
|
15
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-1.jpg',
|
16
|
+
name: '张三',
|
17
|
+
id: 'EMP10086',
|
18
|
+
department: '研发部'
|
19
|
+
}"
|
20
|
+
/></code></pre>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="section">
|
25
|
+
<h2>不同头像尺寸</h2>
|
26
|
+
<div class="example-block">
|
27
|
+
<div class="avatar-size-container">
|
28
|
+
<div v-for="size in avatarSizes" :key="size" class="avatar-size-item">
|
29
|
+
<ebiz-employee-info
|
30
|
+
:info="basicEmployee"
|
31
|
+
:avatar-size="size"
|
32
|
+
/>
|
33
|
+
<div class="size-label">size: {{ size }}</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
<div class="code-block">
|
38
|
+
<pre><code><ebiz-employee-info
|
39
|
+
:info="employeeInfo"
|
40
|
+
avatar-size="large"
|
41
|
+
/></code></pre>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div class="section">
|
46
|
+
<h2>方形头像</h2>
|
47
|
+
<div class="example-block">
|
48
|
+
<ebiz-employee-info
|
49
|
+
:info="basicEmployee"
|
50
|
+
avatar-shape="round"
|
51
|
+
/>
|
52
|
+
</div>
|
53
|
+
<div class="code-block">
|
54
|
+
<pre><code><ebiz-employee-info
|
55
|
+
:info="employeeInfo"
|
56
|
+
avatar-shape="round"
|
57
|
+
/></code></pre>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div class="section">
|
62
|
+
<h2>无头像处理</h2>
|
63
|
+
<div class="example-block">
|
64
|
+
<ebiz-employee-info
|
65
|
+
:info="noAvatarEmployee"
|
66
|
+
/>
|
67
|
+
</div>
|
68
|
+
<div class="code-block">
|
69
|
+
<pre><code><ebiz-employee-info
|
70
|
+
:info="{
|
71
|
+
name: '李四',
|
72
|
+
id: 'EMP10087',
|
73
|
+
department: '市场部'
|
74
|
+
}"
|
75
|
+
/></code></pre>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div class="section">
|
80
|
+
<h2>自定义样式</h2>
|
81
|
+
<div class="example-block">
|
82
|
+
<ebiz-employee-info
|
83
|
+
:info="basicEmployee"
|
84
|
+
width="350px"
|
85
|
+
class="custom-employee-info"
|
86
|
+
/>
|
87
|
+
</div>
|
88
|
+
<div class="code-block">
|
89
|
+
<pre><code><ebiz-employee-info
|
90
|
+
:info="employeeInfo"
|
91
|
+
width="350px"
|
92
|
+
class="custom-employee-info"
|
93
|
+
/>
|
94
|
+
|
95
|
+
<style>
|
96
|
+
.custom-employee-info {
|
97
|
+
background-color: #f0f8ff;
|
98
|
+
border: 1px solid #d1e9ff;
|
99
|
+
}
|
100
|
+
</style></code></pre>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="section">
|
105
|
+
<h2>多个员工信息</h2>
|
106
|
+
<div class="example-block">
|
107
|
+
<div class="employee-list">
|
108
|
+
<ebiz-employee-info
|
109
|
+
v-for="(employee, index) in employeeList"
|
110
|
+
:key="index"
|
111
|
+
:info="employee"
|
112
|
+
class="employee-list-item"
|
113
|
+
/>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
<div class="code-block">
|
117
|
+
<pre><code><div class="employee-list">
|
118
|
+
<ebiz-employee-info
|
119
|
+
v-for="(employee, index) in employeeList"
|
120
|
+
:key="index"
|
121
|
+
:info="employee"
|
122
|
+
class="employee-list-item"
|
123
|
+
/>
|
124
|
+
</div></code></pre>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
</template>
|
129
|
+
|
130
|
+
<script>
|
131
|
+
import { EbizEmployeeInfo } from '../index.js'
|
132
|
+
|
133
|
+
export default {
|
134
|
+
name: 'EbizEmployeeInfoDemo',
|
135
|
+
components: {
|
136
|
+
EbizEmployeeInfo
|
137
|
+
},
|
138
|
+
data() {
|
139
|
+
return {
|
140
|
+
basicEmployee: {
|
141
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-1.jpg',
|
142
|
+
name: '张三',
|
143
|
+
id: 'EMP10086',
|
144
|
+
department: '研发部'
|
145
|
+
},
|
146
|
+
noAvatarEmployee: {
|
147
|
+
name: '李四',
|
148
|
+
id: 'EMP10087',
|
149
|
+
department: '市场部'
|
150
|
+
},
|
151
|
+
avatarSizes: ['small', 'medium', 'large'],
|
152
|
+
employeeList: [
|
153
|
+
{
|
154
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-1.jpg',
|
155
|
+
name: '张三',
|
156
|
+
id: 'EMP10086',
|
157
|
+
department: '研发部'
|
158
|
+
},
|
159
|
+
{
|
160
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-2.jpg',
|
161
|
+
name: '李四',
|
162
|
+
id: 'EMP10087',
|
163
|
+
department: '市场部'
|
164
|
+
},
|
165
|
+
{
|
166
|
+
avatar: 'https://tdesign.tencent.com/vue-next/assets/avatar-3.jpg',
|
167
|
+
name: '王五',
|
168
|
+
id: 'EMP10088',
|
169
|
+
department: '产品部'
|
170
|
+
},
|
171
|
+
{
|
172
|
+
name: '赵六',
|
173
|
+
id: 'EMP10089',
|
174
|
+
department: '设计部'
|
175
|
+
}
|
176
|
+
]
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
</script>
|
181
|
+
|
182
|
+
<style lang="less" scoped>
|
183
|
+
.container {
|
184
|
+
padding: 20px;
|
185
|
+
|
186
|
+
h1 {
|
187
|
+
margin-bottom: 20px;
|
188
|
+
}
|
189
|
+
|
190
|
+
.section {
|
191
|
+
margin-bottom: 30px;
|
192
|
+
|
193
|
+
h2 {
|
194
|
+
margin-bottom: 15px;
|
195
|
+
}
|
196
|
+
|
197
|
+
.example-block {
|
198
|
+
margin-bottom: 15px;
|
199
|
+
padding: 20px;
|
200
|
+
border: 1px solid #eee;
|
201
|
+
border-radius: 4px;
|
202
|
+
}
|
203
|
+
|
204
|
+
.code-block {
|
205
|
+
background-color: #f5f5f5;
|
206
|
+
padding: 15px;
|
207
|
+
border-radius: 4px;
|
208
|
+
|
209
|
+
pre {
|
210
|
+
margin: 0;
|
211
|
+
white-space: pre-wrap;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
|
216
|
+
.avatar-size-container {
|
217
|
+
display: flex;
|
218
|
+
flex-direction: column;
|
219
|
+
gap: 20px;
|
220
|
+
}
|
221
|
+
|
222
|
+
.avatar-size-item {
|
223
|
+
position: relative;
|
224
|
+
|
225
|
+
.size-label {
|
226
|
+
position: absolute;
|
227
|
+
right: 20px;
|
228
|
+
top: 50%;
|
229
|
+
transform: translateY(-50%);
|
230
|
+
font-size: 14px;
|
231
|
+
color: #666;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
.employee-list {
|
236
|
+
display: flex;
|
237
|
+
flex-direction: column;
|
238
|
+
gap: 15px;
|
239
|
+
}
|
240
|
+
|
241
|
+
.employee-list-item {
|
242
|
+
border: 1px solid #eaeaea;
|
243
|
+
}
|
244
|
+
|
245
|
+
.custom-employee-info {
|
246
|
+
background-color: #f0f8ff;
|
247
|
+
border: 1px solid #d1e9ff;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
</style>
|
@@ -0,0 +1,152 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="radio-demo">
|
3
|
+
<h2>Radio 单选框组件</h2>
|
4
|
+
|
5
|
+
<h3>基础单选框</h3>
|
6
|
+
<div class="demo-section">
|
7
|
+
<ebiz-radio label="未选中项" />
|
8
|
+
<ebiz-radio label="允许取消选中项" :allowUncheck="true" v-model="radio1" />
|
9
|
+
<ebiz-radio label="选中项" v-model="radio2" />
|
10
|
+
<ebiz-radio label="选中禁用态" disabled v-model="radioDisabled" />
|
11
|
+
<ebiz-radio label="未选中禁用态" disabled />
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<h3>按钮单选框组</h3>
|
15
|
+
<div class="demo-section">
|
16
|
+
<h4>边框型单选按钮</h4>
|
17
|
+
<ebiz-radio-group v-model="group1" variant="outline">
|
18
|
+
<ebiz-radio value="1" label="选项一" />
|
19
|
+
<ebiz-radio value="2" label="选项二" />
|
20
|
+
<ebiz-radio value="3" label="选项三" />
|
21
|
+
<ebiz-radio value="4" label="选项四" />
|
22
|
+
<ebiz-radio value="5" label="选项五" />
|
23
|
+
</ebiz-radio-group>
|
24
|
+
|
25
|
+
<h4>填充型单选按钮</h4>
|
26
|
+
<ebiz-radio-group v-model="group2" variant="primary-filled">
|
27
|
+
<ebiz-radio value="1" label="选项一" />
|
28
|
+
<ebiz-radio value="2" label="选项二" />
|
29
|
+
<ebiz-radio value="3" label="选项三" />
|
30
|
+
<ebiz-radio value="4" label="选项四" />
|
31
|
+
<ebiz-radio value="5" label="选项五" />
|
32
|
+
</ebiz-radio-group>
|
33
|
+
|
34
|
+
<h4>带禁用状态的单选按钮</h4>
|
35
|
+
<ebiz-radio-group v-model="group3">
|
36
|
+
<ebiz-radio value="1" label="选项一" />
|
37
|
+
<ebiz-radio value="2" label="选项二" />
|
38
|
+
<ebiz-radio value="3" label="选项三" />
|
39
|
+
<ebiz-radio value="4" label="选中禁用态" disabled />
|
40
|
+
<ebiz-radio value="5" label="未选中禁用态" disabled />
|
41
|
+
</ebiz-radio-group>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<h3>不同尺寸的单选按钮</h3>
|
45
|
+
<div class="demo-section">
|
46
|
+
<h4>大尺寸</h4>
|
47
|
+
<ebiz-radio-group v-model="groupSize1" size="large">
|
48
|
+
<ebiz-radio value="1" label="选项一" />
|
49
|
+
<ebiz-radio value="2" label="选项二" />
|
50
|
+
<ebiz-radio value="3" label="选项三" />
|
51
|
+
<ebiz-radio value="4" label="选项四" />
|
52
|
+
</ebiz-radio-group>
|
53
|
+
|
54
|
+
<h4>中尺寸(默认)</h4>
|
55
|
+
<ebiz-radio-group v-model="groupSize2" size="medium">
|
56
|
+
<ebiz-radio value="1" label="选项一" />
|
57
|
+
<ebiz-radio value="2" label="选项二" />
|
58
|
+
<ebiz-radio value="3" label="选项三" />
|
59
|
+
<ebiz-radio value="4" label="选项四" />
|
60
|
+
</ebiz-radio-group>
|
61
|
+
|
62
|
+
<h4>小尺寸</h4>
|
63
|
+
<ebiz-radio-group v-model="groupSize3" size="small">
|
64
|
+
<ebiz-radio value="1" label="选项一" />
|
65
|
+
<ebiz-radio value="2" label="选项二" />
|
66
|
+
<ebiz-radio value="3" label="选项三" />
|
67
|
+
<ebiz-radio value="4" label="选项四" />
|
68
|
+
</ebiz-radio-group>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
<h3>使用options配置的单选框组</h3>
|
72
|
+
<div class="demo-section">
|
73
|
+
<ebiz-radio-group
|
74
|
+
:options="[
|
75
|
+
{ label: '选项一', value: '1' },
|
76
|
+
{ label: '选项二', value: '2' },
|
77
|
+
{ label: '选项三', value: '3' },
|
78
|
+
{ label: '禁用选项', value: '4', disabled: true }
|
79
|
+
]"
|
80
|
+
v-model="optionsGroup"
|
81
|
+
/>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<h3>可取消选中的单选框组</h3>
|
85
|
+
<div class="demo-section">
|
86
|
+
<ebiz-radio-group
|
87
|
+
:allowUncheck="true"
|
88
|
+
:options="[
|
89
|
+
{ label: '可取消选中项一', value: '1' },
|
90
|
+
{ label: '可取消选中项二', value: '2' },
|
91
|
+
{ label: '可取消选中项三', value: '3' }
|
92
|
+
]"
|
93
|
+
v-model="uncheckGroup"
|
94
|
+
/>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
</template>
|
98
|
+
|
99
|
+
<script>
|
100
|
+
export default {
|
101
|
+
name: 'EbizRadioDemo'
|
102
|
+
}
|
103
|
+
</script>
|
104
|
+
|
105
|
+
<script setup>
|
106
|
+
import { ref } from 'vue';
|
107
|
+
import { EbizRadio, EbizRadioGroup } from '../index.js';
|
108
|
+
|
109
|
+
// 单选框状态
|
110
|
+
const radio1 = ref(true);
|
111
|
+
const radio2 = ref(true);
|
112
|
+
const radioDisabled = ref(true);
|
113
|
+
|
114
|
+
// 单选组状态
|
115
|
+
const group1 = ref('1');
|
116
|
+
const group2 = ref('1');
|
117
|
+
const group3 = ref('1');
|
118
|
+
|
119
|
+
// 不同尺寸的单选组
|
120
|
+
const groupSize1 = ref('1');
|
121
|
+
const groupSize2 = ref('1');
|
122
|
+
const groupSize3 = ref('1');
|
123
|
+
|
124
|
+
// options配置的单选组
|
125
|
+
const optionsGroup = ref('1');
|
126
|
+
|
127
|
+
// 可取消选中的单选组
|
128
|
+
const uncheckGroup = ref('1');
|
129
|
+
</script>
|
130
|
+
|
131
|
+
<style scoped>
|
132
|
+
.radio-demo {
|
133
|
+
padding: 20px;
|
134
|
+
}
|
135
|
+
|
136
|
+
.demo-section {
|
137
|
+
margin-bottom: 30px;
|
138
|
+
border: 1px solid #eee;
|
139
|
+
padding: 16px;
|
140
|
+
border-radius: 6px;
|
141
|
+
}
|
142
|
+
|
143
|
+
h3 {
|
144
|
+
margin-top: 24px;
|
145
|
+
margin-bottom: 16px;
|
146
|
+
}
|
147
|
+
|
148
|
+
h4 {
|
149
|
+
margin-top: 16px;
|
150
|
+
margin-bottom: 8px;
|
151
|
+
}
|
152
|
+
</style>
|