@ebiz/designer-components 0.0.36 → 0.0.38

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.
@@ -0,0 +1,302 @@
1
+ <template>
2
+ <div class="ebiz-dialog-demo">
3
+ <h2>高级弹窗组件示例</h2>
4
+
5
+ <div class="demo-section">
6
+ <h3>1. 标准弹窗</h3>
7
+ <t-button @click="openNormalDialog">打开标准弹窗</t-button>
8
+ <EbizSDialog ref="normalDialogRef" dialogType="normal" title="标准弹窗示例">
9
+ <template #body>
10
+ <div class="dialog-content">
11
+ <p>这是一个标准弹窗的内容区域。</p>
12
+ <p>可以通过ref调用openDialog和closeDialog方法来控制弹窗的显示和隐藏。</p>
13
+ </div>
14
+ </template>
15
+ </EbizSDialog>
16
+ </div>
17
+
18
+ <div class="demo-section">
19
+ <h3>2. 表单弹窗</h3>
20
+ <t-space>
21
+ <t-button @click="openFormDialog">打开表单弹窗</t-button>
22
+ <t-button theme="default" @click="resetForm">重置表单</t-button>
23
+ <t-button theme="default" @click="validateFormData">验证表单</t-button>
24
+ <t-button theme="default" @click="getFormDataDemo">获取表单数据</t-button>
25
+ </t-space>
26
+ <EbizSDialog ref="formDialogRef" dialogType="add" title="添加用户" :rules="formRules" layout="vertical"
27
+ labelWidth="100px" :apiConfig="mockApiConfig" @submit="handleFormSubmit">
28
+ <template #body>
29
+ <t-form-item label="用户名" name="username">
30
+ <t-input v-model="formUsername" placeholder="请输入用户名"></t-input>
31
+ </t-form-item>
32
+ <t-form-item label="电子邮箱" name="email">
33
+ <t-input v-model="formEmail" placeholder="请输入电子邮箱"></t-input>
34
+ </t-form-item>
35
+ <t-form-item label="年龄" name="age">
36
+ <t-input-number v-model="formAge" placeholder="请输入年龄"></t-input-number>
37
+ </t-form-item>
38
+ </template>
39
+ </EbizSDialog>
40
+ </div>
41
+
42
+ <div class="demo-section">
43
+ <h3>3. 编辑和删除操作</h3>
44
+ <t-table :data="tableData" :columns="columns" row-key="id" bordered>
45
+ <template #op="slotProps">
46
+ <t-button size="small" theme="primary" style="margin-right: 8px;"
47
+ @click="openEditDialog(slotProps.row)">编辑</t-button>
48
+ <t-button size="small" theme="danger" @click="openDeleteDialog(slotProps.row)">删除</t-button>
49
+ </template>
50
+ </t-table>
51
+
52
+ <EbizSDialog ref="deleteDialogRef" :apiConfig="mockDeleteApiConfig" dialogType="delete" deleteConfirmMessage="确定要删除该用户吗?此操作不可恢复!"
53
+ @dialog-confirm="handleDelete">
54
+ </EbizSDialog>
55
+
56
+ <EbizSDialog ref="editDialogRef" dialogType="edit" title="编辑用户" :rules="formRules" layout="vertical"
57
+ labelWidth="100px" :detailApiConfig="mockDetailApiConfig" :apiConfig="mockApiConfig" @detail-loaded="handleDetailLoaded"
58
+ @dialog-confirm="handleEditSubmit">
59
+ <template #body>
60
+ <t-form-item label="用户名" name="username">
61
+ <t-input v-model="editUsername" placeholder="请输入用户名"></t-input>
62
+ </t-form-item>
63
+ <t-form-item label="电子邮箱" name="email">
64
+ <t-input v-model="editEmail" placeholder="请输入电子邮箱"></t-input>
65
+ </t-form-item>
66
+ <t-form-item label="年龄" name="age">
67
+ <t-input-number v-model="editAge" placeholder="请输入年龄"></t-input-number>
68
+ </t-form-item>
69
+ </template>
70
+ </EbizSDialog>
71
+ </div>
72
+ </div>
73
+ </template>
74
+
75
+ <script setup>
76
+ import { ref, reactive } from 'vue';
77
+ import { EbizSDialog } from '../index.js';
78
+ import {
79
+ Button as TButton,
80
+ FormItem as TFormItem,
81
+ Input as TInput,
82
+ InputNumber as TInputNumber,
83
+ Table as TTable,
84
+ Space as TSpace,
85
+ MessagePlugin
86
+ } from 'tdesign-vue-next';
87
+
88
+ // 标准弹窗引用
89
+ const normalDialogRef = ref(null);
90
+
91
+ // 表单弹窗相关
92
+ const formDialogRef = ref(null);
93
+ const formUsername = ref('');
94
+ const formEmail = ref('');
95
+ const formAge = ref(18);
96
+
97
+ // 编辑弹窗相关
98
+ const editDialogRef = ref(null);
99
+ const editUsername = ref('');
100
+ const editEmail = ref('');
101
+ const editAge = ref(18);
102
+
103
+ // 表单验证规则
104
+ const formRules = {
105
+ username: [
106
+ { required: true, message: '用户名不能为空', type: 'error' },
107
+ { min: 3, message: '用户名不能少于3个字符', type: 'error' }
108
+ ],
109
+ email: [
110
+ { required: true, message: '邮箱不能为空', type: 'error' },
111
+ { pattern: /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/, message: '请输入正确的邮箱格式', type: 'error' }
112
+ ],
113
+ age: [
114
+ { required: true, message: '年龄不能为空', type: 'error' },
115
+ { validator: (val) => val >= 18, message: '年龄必须大于等于18岁', type: 'error' }
116
+ ]
117
+ };
118
+
119
+ // 表格数据
120
+ const tableData = reactive([
121
+ { id: 1, username: '张三', email: 'zhangsan@example.com', age: 28 },
122
+ { id: 2, username: '李四', email: 'lisi@example.com', age: 32 },
123
+ { id: 3, username: '王五', email: 'wangwu@example.com', age: 25 }
124
+ ]);
125
+
126
+ // 表格列定义
127
+ const columns = [
128
+ { colKey: 'id', title: 'ID', width: 80 },
129
+ { colKey: 'username', title: '用户名' },
130
+ { colKey: 'email', title: '电子邮箱' },
131
+ { colKey: 'age', title: '年龄' },
132
+ { colKey: 'op', title: '操作', width: 180 }
133
+ ];
134
+
135
+ // 删除弹窗相关
136
+ const deleteDialogRef = ref(null);
137
+ const currentDeleteRow = ref(null);
138
+
139
+ // 编辑弹窗相关
140
+ const currentEditRow = ref(null);
141
+
142
+ const mockApiConfig = {
143
+ "key": "testInsert",
144
+ "apiId": 1955,
145
+ "apiType": 5
146
+ }
147
+ // 模拟详情API配置
148
+ const mockDetailApiConfig = {
149
+ "key": "testDetail",
150
+ "apiId": 2157,
151
+ "apiType": 1
152
+ };
153
+ const mockDeleteApiConfig = {
154
+ "key": "testDelete",
155
+ "apiId": 2158,
156
+ "apiType": 1
157
+ }
158
+
159
+ // 打开标准弹窗
160
+ const openNormalDialog = () => {
161
+ normalDialogRef.value.openDialog();
162
+ };
163
+
164
+ // 打开表单弹窗
165
+ const openFormDialog = () => {
166
+ formUsername.value = '';
167
+ formEmail.value = '';
168
+ formAge.value = 18;
169
+
170
+ formDialogRef.value.openDialog({
171
+ formData: {
172
+ username: formUsername,
173
+ email: formEmail,
174
+ age: formAge
175
+ }
176
+ });
177
+ };
178
+
179
+ // 重置表单数据
180
+ const resetForm = () => {
181
+ if (formDialogRef.value) {
182
+ const result = formDialogRef.value.resetFormData();
183
+ MessagePlugin.info(result.message);
184
+ }
185
+ };
186
+
187
+ // 验证表单数据
188
+ const validateFormData = async () => {
189
+ if (formDialogRef.value) {
190
+ const result = await formDialogRef.value.validateForm();
191
+ if (result.success) {
192
+ MessagePlugin.success(result.message);
193
+ } else {
194
+ MessagePlugin.error(result.message);
195
+ }
196
+ }
197
+ };
198
+
199
+ // 获取表单数据
200
+ const getFormDataDemo = () => {
201
+ if (formDialogRef.value) {
202
+ const formData = formDialogRef.value.getFormData();
203
+ MessagePlugin.info(`当前表单数据: ${JSON.stringify(formData)}`);
204
+ }
205
+ };
206
+
207
+ // 处理表单提交
208
+ const handleFormSubmit = ({ formData }) => {
209
+ MessagePlugin.success(`表单提交成功: ${JSON.stringify(formData)}`);
210
+
211
+ // 添加到表格中
212
+ const newId = Math.max(...tableData.map(item => item.id)) + 1;
213
+ tableData.push({
214
+ id: newId,
215
+ username: formData.username,
216
+ email: formData.email,
217
+ age: formData.age
218
+ });
219
+ };
220
+
221
+ // 打开删除确认弹窗
222
+ const openDeleteDialog = (row) => {
223
+ currentDeleteRow.value = row;
224
+ deleteDialogRef.value.openDialog({
225
+ id: row.id
226
+ });
227
+ };
228
+
229
+ // 打开编辑弹窗
230
+ const openEditDialog = (row) => {
231
+ // 保存当前编辑的行
232
+ currentEditRow.value = row;
233
+
234
+ editUsername.value = row.username;
235
+ editEmail.value = row.email;
236
+ editAge.value = row.age;
237
+
238
+ // 使用新增的方法打开弹窗并加载数据
239
+ editDialogRef.value.openDialog({
240
+ id: row.id
241
+ });
242
+ };
243
+
244
+ // 处理详情数据加载成功
245
+ const handleDetailLoaded = (data) => {
246
+ // 详情数据加载成功后,会自动设置到表单中
247
+ MessagePlugin.info(`用户数据加载成功: ${data.username}`);
248
+ };
249
+
250
+ // 处理删除确认
251
+ const handleDelete = async () => {
252
+ if (currentDeleteRow.value) {
253
+ const index = tableData.findIndex(item => item.id === currentDeleteRow.value.id);
254
+ if (index !== -1) {
255
+ tableData.splice(index, 1);
256
+ MessagePlugin.success('删除成功');
257
+ }
258
+ }
259
+ };
260
+
261
+ // 处理编辑提交
262
+ const handleEditSubmit = async () => {
263
+ // 在真实环境中,API调用会由组件自动处理
264
+ // 这里模拟编辑成功后的处理
265
+ if (currentEditRow.value) {
266
+ const index = tableData.findIndex(item => item.id === currentEditRow.value.id);
267
+ if (index !== -1) {
268
+ // 获取表单数据
269
+ const formData = editDialogRef.value.getFormData();
270
+
271
+ // 更新表格数据
272
+ tableData[index].username = formData.username;
273
+ tableData[index].email = formData.email;
274
+ tableData[index].age = formData.age;
275
+
276
+ MessagePlugin.success('编辑成功');
277
+ }
278
+ }
279
+ };
280
+ </script>
281
+
282
+ <style scoped>
283
+ .ebiz-dialog-demo {
284
+ padding: 20px;
285
+ }
286
+
287
+ .demo-section {
288
+ margin-bottom: 30px;
289
+ padding: 20px;
290
+ border: 1px solid #dcdcdc;
291
+ border-radius: 6px;
292
+ }
293
+
294
+ .dialog-content {
295
+ padding: 10px;
296
+ }
297
+
298
+ h3 {
299
+ margin-top: 0;
300
+ margin-bottom: 16px;
301
+ }
302
+ </style>
@@ -0,0 +1,360 @@
1
+ <template>
2
+ <div class="component-demo">
3
+ <h2>高级表单组件</h2>
4
+ <div class="demo-section">
5
+ <h3>基础表单示例</h3>
6
+ <div class="demo-block">
7
+ <ebiz-s-form
8
+ ref="basicFormRef"
9
+ :data="formData"
10
+ :rules="formRules"
11
+ show-error-message
12
+ @success="handleSuccess"
13
+ @error="handleError">
14
+ <ebiz-s-form-item label="姓名" name="name" type="input" placeholder="请输入姓名"></ebiz-s-form-item>
15
+ <ebiz-s-form-item label="年龄" name="age" type="number" placeholder="请输入年龄"></ebiz-s-form-item>
16
+ <ebiz-s-form-item label="性别" name="gender" type="radio" :options="genderOptions"></ebiz-s-form-item>
17
+ <ebiz-s-form-item label="爱好" name="hobbies" type="checkbox" :options="hobbyOptions"></ebiz-s-form-item>
18
+ <ebiz-s-form-item label="职业" name="occupation" type="select" :options="occupationOptions"></ebiz-s-form-item>
19
+ <ebiz-s-form-item label="出生日期" name="birthday" type="date"></ebiz-s-form-item>
20
+ <ebiz-s-form-item label="简介" name="bio" type="textarea" placeholder="请输入个人简介"></ebiz-s-form-item>
21
+ </ebiz-s-form>
22
+ </div>
23
+ </div>
24
+
25
+ <div class="demo-section">
26
+ <h3>编辑表单示例(支持详情接口)</h3>
27
+ <div class="demo-block">
28
+ <t-space>
29
+ <t-button @click="openEditFormWithData">打开编辑表单(预设数据)</t-button>
30
+ <t-button @click="openEditFormWithId">打开编辑表单(加载详情)</t-button>
31
+ </t-space>
32
+ <ebiz-s-form
33
+ ref="editFormRef"
34
+ :api-config="submitApiConfig"
35
+ :detail-api-config="detailApiConfig"
36
+ :rules="editFormRules"
37
+ show-error-message
38
+ reset-on-success
39
+ @success="handleEditSuccess"
40
+ @error="handleEditError"
41
+ @detail-loaded="handleDetailLoaded">
42
+ <ebiz-s-form-item label="ID" name="id" type="input" disabled></ebiz-s-form-item>
43
+ <ebiz-s-form-item label="标题" name="title" type="input" placeholder="请输入标题"></ebiz-s-form-item>
44
+ <ebiz-s-form-item label="内容" name="body" type="textarea" placeholder="请输入内容"></ebiz-s-form-item>
45
+ <ebiz-s-form-item label="用户ID" name="userId" type="number" placeholder="请输入用户ID"></ebiz-s-form-item>
46
+ </ebiz-s-form>
47
+ </div>
48
+ </div>
49
+
50
+ <div class="demo-section">
51
+ <h3>行内表单示例</h3>
52
+ <div class="demo-block">
53
+ <ebiz-s-form
54
+ :data="inlineFormData"
55
+ layout="inline"
56
+ label-width="60px">
57
+ <ebiz-s-form-item label="用户名" name="username" type="input" placeholder="请输入用户名"></ebiz-s-form-item>
58
+ <ebiz-s-form-item label="密码" name="password" type="input" placeholder="请输入密码"></ebiz-s-form-item>
59
+ </ebiz-s-form>
60
+ </div>
61
+ </div>
62
+
63
+ <div class="demo-section">
64
+ <h3>表单方法调用示例</h3>
65
+ <div class="demo-block">
66
+ <t-space>
67
+ <t-button @click="validateForm">验证表单</t-button>
68
+ <t-button @click="getFormValues">获取表单值</t-button>
69
+ <t-button @click="resetForm">重置表单</t-button>
70
+ <t-button @click="setFormValues">设置表单值</t-button>
71
+ </t-space>
72
+ <ebiz-s-form ref="methodFormRef" :rules="methodFormRules">
73
+ <ebiz-s-form-item label="用户名" name="username" type="input" placeholder="请输入用户名"></ebiz-s-form-item>
74
+ <ebiz-s-form-item label="邮箱" name="email" type="input" placeholder="请输入邮箱"></ebiz-s-form-item>
75
+ <ebiz-s-form-item label="密码" name="password" type="input" placeholder="请输入密码"></ebiz-s-form-item>
76
+ </ebiz-s-form>
77
+ </div>
78
+ </div>
79
+
80
+ <div class="demo-section">
81
+ <h3>顶部标签表单示例</h3>
82
+ <div class="demo-block">
83
+ <ebiz-s-form
84
+ :data="topLabelFormData"
85
+ label-align="top">
86
+ <ebiz-s-form-item label="邮箱" name="email" type="input" placeholder="请输入邮箱"></ebiz-s-form-item>
87
+ <ebiz-s-form-item label="手机号" name="phone" type="input" placeholder="请输入手机号"></ebiz-s-form-item>
88
+ <ebiz-s-form-item label="是否启用" name="enabled" type="switch"></ebiz-s-form-item>
89
+ </ebiz-s-form>
90
+ </div>
91
+ </div>
92
+
93
+ <div class="demo-section">
94
+ <h3>自定义表单按钮示例</h3>
95
+ <div class="demo-block">
96
+ <ebiz-s-form :data="customButtonsFormData">
97
+ <ebiz-s-form-item label="名称" name="name" type="input" placeholder="请输入名称"></ebiz-s-form-item>
98
+ <template #buttons>
99
+ <t-space>
100
+ <t-button theme="default">返回</t-button>
101
+ <t-button theme="primary">保存草稿</t-button>
102
+ <t-button theme="success">提交审核</t-button>
103
+ </t-space>
104
+ </template>
105
+ </ebiz-s-form>
106
+ </div>
107
+ </div>
108
+ </div>
109
+ </template>
110
+
111
+ <script>
112
+ import { reactive, ref } from 'vue';
113
+ import { EbizSForm, EbizSFormItem } from '../../index.js';
114
+ import { Button as TButton, Space as TSpace, MessagePlugin } from 'tdesign-vue-next';
115
+
116
+ export default {
117
+ name: 'EbizSFormDemo',
118
+ components: {
119
+ EbizSForm,
120
+ EbizSFormItem,
121
+ TButton,
122
+ TSpace
123
+ },
124
+ setup() {
125
+ // 表单引用
126
+ const basicFormRef = ref(null);
127
+ const editFormRef = ref(null);
128
+ const methodFormRef = ref(null);
129
+
130
+ // 基础表单数据
131
+ const formData = reactive({
132
+ name: '',
133
+ age: null,
134
+ gender: '',
135
+ hobbies: [],
136
+ occupation: '',
137
+ birthday: '',
138
+ bio: ''
139
+ });
140
+
141
+ // 表单验证规则
142
+ const formRules = {
143
+ name: [{ required: true, message: '请输入姓名', type: 'error' }],
144
+ age: [
145
+ { required: true, message: '请输入年龄', type: 'error' },
146
+ { validator: (val) => val >= 18, message: '年龄必须大于等于18岁', type: 'error' }
147
+ ],
148
+ gender: [{ required: true, message: '请选择性别', type: 'error' }]
149
+ };
150
+
151
+ // 编辑表单验证规则
152
+ const editFormRules = {
153
+ title: [{ required: true, message: '请输入标题', type: 'error' }],
154
+ body: [{ required: true, message: '请输入内容', type: 'error' }],
155
+ userId: [{ required: true, message: '请输入用户ID', type: 'error' }]
156
+ };
157
+
158
+ // 方法示例表单验证规则
159
+ const methodFormRules = {
160
+ username: [{ required: true, message: '请输入用户名', type: 'error' }],
161
+ email: [
162
+ { required: true, message: '请输入邮箱', type: 'error' },
163
+ { validator: (val) => /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(val), message: '请输入有效的邮箱地址', type: 'error' }
164
+ ],
165
+ password: [
166
+ { required: true, message: '请输入密码', type: 'error' },
167
+ { validator: (val) => val.length >= 6, message: '密码长度至少为6位', type: 'error' }
168
+ ]
169
+ };
170
+
171
+ // 选项数据
172
+ const genderOptions = [
173
+ { label: '男', value: 'male' },
174
+ { label: '女', value: 'female' }
175
+ ];
176
+
177
+ const hobbyOptions = [
178
+ { label: '阅读', value: 'reading' },
179
+ { label: '音乐', value: 'music' },
180
+ { label: '电影', value: 'movie' },
181
+ { label: '运动', value: 'sports' }
182
+ ];
183
+
184
+ const occupationOptions = [
185
+ { label: '工程师', value: 'engineer' },
186
+ { label: '设计师', value: 'designer' },
187
+ { label: '产品经理', value: 'pm' },
188
+ { label: '运营', value: 'operation' }
189
+ ];
190
+
191
+ // 行内表单数据
192
+ const inlineFormData = reactive({
193
+ username: '',
194
+ password: ''
195
+ });
196
+
197
+ // 顶部标签表单数据
198
+ const topLabelFormData = reactive({
199
+ email: '',
200
+ phone: '',
201
+ enabled: false
202
+ });
203
+
204
+ // 自定义按钮表单数据
205
+ const customButtonsFormData = reactive({
206
+ name: ''
207
+ });
208
+
209
+ // API配置
210
+ const submitApiConfig = {
211
+ url: 'https://jsonplaceholder.typicode.com/posts/{id}',
212
+ method: 'put'
213
+ };
214
+
215
+ // 详情API配置
216
+ const detailApiConfig = {
217
+ url: 'https://jsonplaceholder.typicode.com/posts/{id}',
218
+ method: 'get'
219
+ };
220
+
221
+ // 预设数据
222
+ const predefinedData = {
223
+ id: 1,
224
+ title: '示例标题',
225
+ body: '这是一段示例内容,用于演示表单编辑功能。',
226
+ userId: 1
227
+ };
228
+
229
+ // 成功处理函数
230
+ const handleSuccess = (_response) => {
231
+ MessagePlugin.success(`提交成功!`);
232
+ };
233
+
234
+ // 错误处理函数
235
+ const handleError = (_error) => {
236
+ MessagePlugin.error('提交失败');
237
+ };
238
+
239
+ // 编辑表单成功处理函数
240
+ const handleEditSuccess = (response) => {
241
+ MessagePlugin.success(`编辑成功,ID: ${response.id}`);
242
+ };
243
+
244
+ // 编辑表单错误处理函数
245
+ const handleEditError = (_error) => {
246
+ MessagePlugin.error('编辑失败');
247
+ };
248
+
249
+ // 详情加载成功处理函数
250
+ const handleDetailLoaded = (data) => {
251
+ MessagePlugin.success(`已加载ID为${data.id}的数据`);
252
+ };
253
+
254
+ // 打开编辑表单并预设数据
255
+ const openEditFormWithData = () => {
256
+ editFormRef.value.openForm({
257
+ formData: predefinedData
258
+ });
259
+ };
260
+
261
+ // 打开编辑表单并通过ID加载详情
262
+ const openEditFormWithId = () => {
263
+ // 这里模拟一个随机ID,1-10
264
+ const randomId = Math.floor(Math.random() * 10) + 1;
265
+
266
+ editFormRef.value.openForm({
267
+ id: randomId
268
+ });
269
+ };
270
+
271
+ // 验证表单
272
+ const validateForm = async () => {
273
+ const result = await methodFormRef.value.validate();
274
+ if (result === true) {
275
+ MessagePlugin.success('表单验证通过');
276
+ }
277
+ };
278
+
279
+ // 获取表单值
280
+ const getFormValues = () => {
281
+ const values = methodFormRef.value.getFormData();
282
+ MessagePlugin.info(`表单值: ${JSON.stringify(values)}`);
283
+ };
284
+
285
+ // 重置表单
286
+ const resetForm = () => {
287
+ methodFormRef.value.reset();
288
+ MessagePlugin.success('表单已重置');
289
+ };
290
+
291
+ // 设置表单值
292
+ const setFormValues = () => {
293
+ methodFormRef.value.setFormData({
294
+ username: 'testuser',
295
+ email: 'test@example.com',
296
+ password: 'password123'
297
+ });
298
+ MessagePlugin.success('表单值已设置');
299
+ };
300
+
301
+ return {
302
+ basicFormRef,
303
+ editFormRef,
304
+ methodFormRef,
305
+ formData,
306
+ formRules,
307
+ editFormRules,
308
+ methodFormRules,
309
+ genderOptions,
310
+ hobbyOptions,
311
+ occupationOptions,
312
+ inlineFormData,
313
+ topLabelFormData,
314
+ customButtonsFormData,
315
+ submitApiConfig,
316
+ detailApiConfig,
317
+ handleSuccess,
318
+ handleError,
319
+ handleEditSuccess,
320
+ handleEditError,
321
+ handleDetailLoaded,
322
+ openEditFormWithData,
323
+ openEditFormWithId,
324
+ validateForm,
325
+ getFormValues,
326
+ resetForm,
327
+ setFormValues
328
+ };
329
+ }
330
+ };
331
+ </script>
332
+
333
+ <style scoped>
334
+ .component-demo {
335
+ padding: 20px;
336
+ }
337
+
338
+ .demo-section {
339
+ margin-bottom: 30px;
340
+ }
341
+
342
+ h2 {
343
+ margin-bottom: 20px;
344
+ font-size: 24px;
345
+ color: #333;
346
+ }
347
+
348
+ h3 {
349
+ margin-bottom: 15px;
350
+ font-size: 18px;
351
+ color: #333;
352
+ }
353
+
354
+ .demo-block {
355
+ padding: 20px;
356
+ border: 1px solid #eee;
357
+ border-radius: 6px;
358
+ background-color: #fff;
359
+ }
360
+ </style>