create-weapp-vite 2.3.15 → 2.3.16

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.
Files changed (66) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/{src-D8uqfCKh.js → src-C8kzMXK7.js} +1 -1
  4. package/package.json +1 -1
  5. package/templates/wevu/README.md +3 -3
  6. package/templates/wevu/package.json +1 -1
  7. package/templates/wevu/src/app.vue +1 -60
  8. package/templates/wevu/src/pages/index/index.vue +26 -194
  9. package/templates/wevu/src/pages/layouts/index.vue +0 -18
  10. package/templates/wevu/weapp-vite.config.ts +0 -7
  11. package/templates/wevu-tdesign/README.md +3 -6
  12. package/templates/wevu-tdesign/package.json +1 -1
  13. package/templates/wevu-tdesign/project.private.config.json +0 -66
  14. package/templates/wevu-tdesign/src/app.vue +1 -73
  15. package/templates/wevu-tdesign/src/pages/index/index.vue +19 -362
  16. package/templates/wevu/src/components/InfoPanel/index.vue +0 -52
  17. package/templates/wevu/src/components/StatusPill/index.vue +0 -42
  18. package/templates/wevu/src/packageA/pages/workspace/index.vue +0 -137
  19. package/templates/wevu/src/packageB/pages/settings/index.vue +0 -131
  20. package/templates/wevu/src/pages/overview/index.vue +0 -149
  21. package/templates/wevu-tdesign/public/tabbar/ability-active.png +0 -0
  22. package/templates/wevu-tdesign/public/tabbar/ability.png +0 -0
  23. package/templates/wevu-tdesign/public/tabbar/data-active.png +0 -0
  24. package/templates/wevu-tdesign/public/tabbar/data.png +0 -0
  25. package/templates/wevu-tdesign/public/tabbar/form-active.png +0 -0
  26. package/templates/wevu-tdesign/public/tabbar/form.png +0 -0
  27. package/templates/wevu-tdesign/public/tabbar/home-active.png +0 -0
  28. package/templates/wevu-tdesign/public/tabbar/home.png +0 -0
  29. package/templates/wevu-tdesign/public/tabbar/list-active.png +0 -0
  30. package/templates/wevu-tdesign/public/tabbar/list.png +0 -0
  31. package/templates/wevu-tdesign/src/components/EmptyState/index.vue +0 -36
  32. package/templates/wevu-tdesign/src/components/FilterBar/index.vue +0 -64
  33. package/templates/wevu-tdesign/src/components/FormRow/index.vue +0 -43
  34. package/templates/wevu-tdesign/src/components/FormStep/index.vue +0 -48
  35. package/templates/wevu-tdesign/src/components/KpiBoard/index.vue +0 -145
  36. package/templates/wevu-tdesign/src/components/QuickActionGrid/index.vue +0 -79
  37. package/templates/wevu-tdesign/src/components/ResultCard/index.vue +0 -51
  38. package/templates/wevu-tdesign/src/components/SectionTitle/index.vue +0 -34
  39. package/templates/wevu-tdesign/src/components/TrendCard/index.vue +0 -101
  40. package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/BrokenCard.vue +0 -46
  41. package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/FixedExternalClassCard.vue +0 -50
  42. package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/RecommendedCard.vue +0 -53
  43. package/templates/wevu-tdesign/src/hooks/useDialog.ts +0 -205
  44. package/templates/wevu-tdesign/src/hooks/useFormBinder.ts +0 -17
  45. package/templates/wevu-tdesign/src/hooks/useLayoutFeedbackBridge.ts +0 -17
  46. package/templates/wevu-tdesign/src/hooks/usePullDownRefresh.ts +0 -12
  47. package/templates/wevu-tdesign/src/hooks/useToast.ts +0 -100
  48. package/templates/wevu-tdesign/src/layouts/admin.vue +0 -41
  49. package/templates/wevu-tdesign/src/layouts/default.vue +0 -23
  50. package/templates/wevu-tdesign/src/pages/ability/index.vue +0 -164
  51. package/templates/wevu-tdesign/src/pages/data/index.vue +0 -189
  52. package/templates/wevu-tdesign/src/pages/form/index.vue +0 -271
  53. package/templates/wevu-tdesign/src/pages/layout-feedback/components/FeedbackCallerCard.vue +0 -79
  54. package/templates/wevu-tdesign/src/pages/layout-feedback/index.vue +0 -211
  55. package/templates/wevu-tdesign/src/pages/layout-store/index.vue +0 -127
  56. package/templates/wevu-tdesign/src/pages/layouts/index.vue +0 -120
  57. package/templates/wevu-tdesign/src/pages/list/index.vue +0 -146
  58. package/templates/wevu-tdesign/src/stores/layoutInteractionDemo.ts +0 -129
  59. package/templates/wevu-tdesign/src/subpackages/ability/index.vue +0 -103
  60. package/templates/wevu-tdesign/src/subpackages/lab/class-binding/index.vue +0 -440
  61. package/templates/wevu-tdesign/src/subpackages/lab/index.vue +0 -169
  62. package/templates/wevu-tdesign/src/subpackages/lab/virtual-host-class/index.vue +0 -94
  63. package/templates/wevu-tdesign/src/types/action.ts +0 -14
  64. package/templates/wevu-tdesign/src/types/list.ts +0 -17
  65. package/templates/wevu-tdesign/src/utils/changeEvent.ts +0 -53
  66. package/templates/wevu-tdesign/src/utils/listFilters.ts +0 -34
@@ -1,440 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, reactive, ref, watch } from 'wevu'
3
-
4
- import SectionTitle from '@/components/SectionTitle/index.vue'
5
- import { resolveBooleanChangeValue } from '@/utils/changeEvent'
6
-
7
- definePageJson({
8
- navigationBarTitleText: 'Class 绑定',
9
- backgroundColor: '#f6f7fb',
10
- })
11
-
12
- const isActive = ref(true)
13
- const hasError = ref(false)
14
- const isRound = ref(false)
15
- const isGhost = ref(false)
16
-
17
- function onActiveChange(event: unknown) {
18
- isActive.value = resolveBooleanChangeValue(event, !isActive.value)
19
- }
20
-
21
- function onErrorChange(event: unknown) {
22
- hasError.value = resolveBooleanChangeValue(event, !hasError.value)
23
- }
24
-
25
- function onRoundChange(event: unknown) {
26
- isRound.value = resolveBooleanChangeValue(event, !isRound.value)
27
- }
28
-
29
- function onGhostChange(event: unknown) {
30
- isGhost.value = resolveBooleanChangeValue(event, !isGhost.value)
31
- }
32
-
33
- const classObject = reactive({
34
- 'demo-active': true,
35
- 'text-danger': false,
36
- 'demo-round': false,
37
- 'demo-ghost': false,
38
- })
39
-
40
- watch([isActive, hasError, isRound, isGhost], ([active, error, round, ghost]) => {
41
- classObject['demo-active'] = active
42
- classObject['text-danger'] = error
43
- classObject['demo-round'] = round
44
- classObject['demo-ghost'] = ghost
45
- }, { immediate: true })
46
-
47
- const activeClass = ref('demo-active')
48
- const errorClass = ref('text-danger')
49
- const roundClass = ref('demo-round')
50
- const ghostClass = ref('demo-ghost')
51
-
52
- const activeClassIf = computed(() => (isActive.value ? activeClass.value : ''))
53
- const errorClassIf = computed(() => (hasError.value ? errorClass.value : ''))
54
- const roundClassIf = computed(() => (isRound.value ? roundClass.value : ''))
55
- const ghostClassIf = computed(() => (isGhost.value ? ghostClass.value : ''))
56
- const dynamicKeyClass = computed(() => ({ [activeClass.value]: isActive.value }))
57
-
58
- const styleObject = computed(() => ({
59
- background: hasError.value
60
- ? '#fff1f2'
61
- : isActive.value
62
- ? 'linear-gradient(135deg,#2563eb,#6366f1)'
63
- : '#ffffff',
64
- borderColor: hasError.value ? '#ef4444' : isActive.value ? '#1e40af' : '#d7d9f2',
65
- borderStyle: isGhost.value ? 'dashed' : 'solid',
66
- borderRadius: isRound.value ? '999rpx' : '18rpx',
67
- color: hasError.value ? '#b91c1c' : isActive.value ? '#ffffff' : '#1f1a3f',
68
- }))
69
-
70
- const styleArray = computed(() => ([
71
- { transition: 'all 0.2s ease' },
72
- isActive.value ? { transform: 'translateY(-4rpx)' } : { transform: 'translateY(0rpx)' },
73
- hasError.value
74
- ? { boxShadow: '0 18rpx 32rpx rgba(239,68,68,0.2)' }
75
- : { boxShadow: '0 10rpx 20rpx rgba(37,99,235,0.28)' },
76
- isRound.value ? { borderRadius: '999rpx' } : { borderRadius: '18rpx' },
77
- isGhost.value ? { opacity: '0.78' } : { opacity: '1' },
78
- ]))
79
-
80
- const styleString = computed(() => {
81
- const fontSize = isActive.value ? 26 : 24
82
- const color = hasError.value ? '#b91c1c' : '#1f1a3f'
83
- const spacing = isGhost.value ? 1.2 : 0.5
84
- return `font-size:${fontSize}rpx;color:${color};letter-spacing:${spacing}rpx;`
85
- })
86
-
87
- const styleWithVar = computed(() => {
88
- const accent = hasError.value ? '#ef4444' : '#2563eb'
89
- return {
90
- '--lab-accent': accent,
91
- 'borderColor': 'var(--lab-accent)',
92
- 'color': 'var(--lab-accent)',
93
- }
94
- })
95
-
96
- function applyScenarioBase() {
97
- isActive.value = false
98
- hasError.value = false
99
- isRound.value = false
100
- isGhost.value = false
101
- }
102
-
103
- function applyScenarioAllOn() {
104
- isActive.value = true
105
- hasError.value = true
106
- isRound.value = true
107
- isGhost.value = true
108
- }
109
-
110
- function applyScenarioMixed() {
111
- isActive.value = true
112
- hasError.value = false
113
- isRound.value = true
114
- isGhost.value = false
115
- }
116
-
117
- function applyScenarioErrorGhost() {
118
- isActive.value = false
119
- hasError.value = true
120
- isRound.value = false
121
- isGhost.value = true
122
- }
123
-
124
- function runE2EState() {
125
- return {
126
- isActive: isActive.value,
127
- hasError: hasError.value,
128
- isRound: isRound.value,
129
- isGhost: isGhost.value,
130
- classObject: { ...classObject },
131
- activeClassIf: activeClassIf.value,
132
- errorClassIf: errorClassIf.value,
133
- roundClassIf: roundClassIf.value,
134
- ghostClassIf: ghostClassIf.value,
135
- styleString: styleString.value,
136
- }
137
- }
138
- </script>
139
-
140
- <template>
141
- <view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
142
- <view class="rounded-[28rpx] bg-linear-to-br from-[#eef2ff] via-[#ffffff] to-[#e0f2fe] p-[20rpx]">
143
- <SectionTitle title="Class 绑定实验室" subtitle="切换状态观察 Vue 3 class 绑定效果" />
144
- </view>
145
-
146
- <view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
147
- <SectionTitle title="状态控制" subtitle="开关影响所有示例" />
148
- <view class="mt-[12rpx] grid grid-cols-2 gap-[12rpx]">
149
- <view class="rounded-[16rpx] bg-[#f8fafc] p-[12rpx]">
150
- <view class="flex items-center justify-between">
151
- <text class="text-[22rpx] text-[#5c5b7a]">
152
- Active
153
- </text>
154
- <t-switch :value="isActive" @change="onActiveChange" />
155
- </view>
156
- </view>
157
- <view class="rounded-[16rpx] bg-[#f8fafc] p-[12rpx]">
158
- <view class="flex items-center justify-between">
159
- <text class="text-[22rpx] text-[#5c5b7a]">
160
- Error
161
- </text>
162
- <t-switch :value="hasError" @change="onErrorChange" />
163
- </view>
164
- </view>
165
- <view class="rounded-[16rpx] bg-[#f8fafc] p-[12rpx]">
166
- <view class="flex items-center justify-between">
167
- <text class="text-[22rpx] text-[#5c5b7a]">
168
- Round
169
- </text>
170
- <t-switch :value="isRound" @change="onRoundChange" />
171
- </view>
172
- </view>
173
- <view class="rounded-[16rpx] bg-[#f8fafc] p-[12rpx]">
174
- <view class="flex items-center justify-between">
175
- <text class="text-[22rpx] text-[#5c5b7a]">
176
- Ghost
177
- </text>
178
- <t-switch :value="isGhost" @change="onGhostChange" />
179
- </view>
180
- </view>
181
- </view>
182
- <view class="mt-[12rpx] flex flex-wrap gap-[12rpx]">
183
- <t-button size="small" variant="outline" @tap="applyScenarioBase">
184
- Base
185
- </t-button>
186
- <t-button size="small" variant="outline" @tap="applyScenarioAllOn">
187
- All On
188
- </t-button>
189
- <t-button size="small" variant="outline" @tap="applyScenarioMixed">
190
- Mixed
191
- </t-button>
192
- <t-button size="small" variant="outline" @tap="applyScenarioErrorGhost">
193
- Error+Ghost
194
- </t-button>
195
- </view>
196
- </view>
197
-
198
- <view class="mt-[18rpx] space-y-[14rpx]">
199
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
200
- <SectionTitle title="对象语法" subtitle="状态驱动 class" />
201
- <view class="mt-[12rpx] demo-block" data-e2e="class-object" :class="{ 'demo-active': isActive }">
202
- <view>
203
- <text class="block text-[24rpx] font-semibold">
204
- Object Syntax
205
- </text>
206
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
207
- active 触发高亮
208
- </text>
209
- </view>
210
- <view class="demo-chip">
211
- Obj
212
- </view>
213
- </view>
214
- </view>
215
-
216
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
217
- <SectionTitle title="静态 + 对象" subtitle="静态 class + 动态对象" />
218
- <view
219
- class="mt-[12rpx] demo-block demo-ghost"
220
- data-e2e="class-static-object"
221
- :class="{ 'demo-active': isActive, 'text-danger': hasError }"
222
- >
223
- <view>
224
- <text class="block text-[24rpx] font-semibold">
225
- Static + Object
226
- </text>
227
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
228
- error 显示警示色
229
- </text>
230
- </view>
231
- <view class="demo-chip">
232
- Mix
233
- </view>
234
- </view>
235
- </view>
236
-
237
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
238
- <SectionTitle title="响应式对象" subtitle="reactive classObject" />
239
- <view class="mt-[12rpx] demo-block" data-e2e="class-reactive" :class="classObject">
240
- <view>
241
- <text class="block text-[24rpx] font-semibold">
242
- Reactive Object
243
- </text>
244
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
245
- 多状态合并控制
246
- </text>
247
- </view>
248
- <view class="demo-chip">
249
- Obj+
250
- </view>
251
- </view>
252
- </view>
253
-
254
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
255
- <SectionTitle title="数组语法" subtitle="数组传入多个 class" />
256
- <view class="mt-[12rpx] demo-block" data-e2e="class-array" :class="[activeClassIf, errorClassIf, roundClassIf]">
257
- <view>
258
- <text class="block text-[24rpx] font-semibold">
259
- Array Syntax
260
- </text>
261
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
262
- 组合多个 class
263
- </text>
264
- </view>
265
- <view class="demo-chip">
266
- Arr
267
- </view>
268
- </view>
269
- </view>
270
-
271
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
272
- <SectionTitle title="数组条件" subtitle="条件判断决定 class" />
273
- <view class="mt-[12rpx] demo-block" data-e2e="class-cond-array" :class="[isActive ? activeClass : '', errorClassIf]">
274
- <view>
275
- <text class="block text-[24rpx] font-semibold">
276
- Conditional Array
277
- </text>
278
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
279
- 条件表达式返回 class
280
- </text>
281
- </view>
282
- <view class="demo-chip">
283
- Cond
284
- </view>
285
- </view>
286
- </view>
287
-
288
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
289
- <SectionTitle title="数组 + 动态 key" subtitle="对象 + 字符串混合" />
290
- <view class="mt-[12rpx] demo-block" data-e2e="class-array-key" :class="[dynamicKeyClass, errorClassIf, ghostClassIf]">
291
- <view>
292
- <text class="block text-[24rpx] font-semibold">
293
- Array + Key
294
- </text>
295
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
296
- 支持计算属性 key
297
- </text>
298
- </view>
299
- <view class="demo-chip">
300
- Key
301
- </view>
302
- </view>
303
- </view>
304
-
305
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
306
- <SectionTitle title="Style 对象语法" subtitle="对象绑定动态 style" />
307
- <view class="mt-[12rpx] demo-block demo-style-anchor" data-e2e="style-object" :style="styleObject">
308
- <view>
309
- <text class="block text-[24rpx] font-semibold">
310
- Style Object
311
- </text>
312
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
313
- 多属性对象绑定
314
- </text>
315
- </view>
316
- <view class="demo-chip">
317
- StyObj
318
- </view>
319
- </view>
320
- </view>
321
-
322
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
323
- <SectionTitle title="Style 数组语法" subtitle="按状态合并样式片段" />
324
- <view class="mt-[12rpx] demo-block demo-style-anchor" data-e2e="style-array" :style="styleArray">
325
- <view>
326
- <text class="block text-[24rpx] font-semibold">
327
- Style Array
328
- </text>
329
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
330
- 条件 style 片段
331
- </text>
332
- </view>
333
- <view class="demo-chip">
334
- StyArr
335
- </view>
336
- </view>
337
- </view>
338
-
339
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
340
- <SectionTitle title="Style 字符串语法" subtitle="拼接结果直出字符串" />
341
- <view class="mt-[12rpx] demo-block demo-style-anchor" data-e2e="style-string" :style="styleString">
342
- <view>
343
- <text class="block text-[24rpx] font-semibold">
344
- Style String
345
- </text>
346
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
347
- string 绑定与条件拼接
348
- </text>
349
- </view>
350
- <view class="demo-chip">
351
- StyStr
352
- </view>
353
- </view>
354
- </view>
355
-
356
- <view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
357
- <SectionTitle title="Style 变量语法" subtitle="CSS 变量与对象混合" />
358
- <view class="mt-[12rpx] demo-block demo-style-anchor" data-e2e="style-var" :style="styleWithVar">
359
- <view>
360
- <text class="block text-[24rpx] font-semibold">
361
- Style Variable
362
- </text>
363
- <text class="mt-[6rpx] block text-[20rpx] demo-subtext">
364
- 变量透传与消费
365
- </text>
366
- </view>
367
- <view class="demo-chip">
368
- StyVar
369
- </view>
370
- </view>
371
- </view>
372
-
373
- <view class="rounded-[24rpx] bg-[#111827] p-[18rpx] text-white">
374
- <text class="text-[20rpx] text-slate-300">
375
- E2E 状态快照
376
- </text>
377
- <text class="mt-[8rpx] block text-[20rpx]" data-e2e="state-line">
378
- {{ runE2EState() }}
379
- </text>
380
- </view>
381
- </view>
382
- </view>
383
- </template>
384
-
385
- <style scoped>
386
- .demo-block {
387
- display: flex;
388
- align-items: center;
389
- justify-content: space-between;
390
- padding: 20rpx;
391
- color: #1f1a3f;
392
- background: #fff;
393
- border: 2rpx solid #d7d9f2;
394
- border-radius: 18rpx;
395
- transition: all 0.2s ease;
396
- }
397
-
398
- .demo-chip {
399
- padding: 6rpx 16rpx;
400
- font-size: 18rpx;
401
- letter-spacing: 0.5rpx;
402
- border: 2rpx solid currentcolor;
403
- border-radius: 999rpx;
404
- }
405
-
406
- .demo-subtext {
407
- color: currentcolor;
408
- opacity: 0.82;
409
- }
410
-
411
- .demo-ghost {
412
- background: #f8fafc;
413
- border-style: dashed;
414
- }
415
-
416
- .demo-round {
417
- border-radius: 999rpx;
418
- }
419
-
420
- .demo-active {
421
- color: #fff;
422
- background: linear-gradient(135deg, #2563eb, #6366f1);
423
- border-color: #1e40af;
424
- box-shadow: 0 18rpx 32rpx rgb(37 99 235 / 35%);
425
- transform: translateY(-4rpx);
426
- }
427
-
428
- .text-danger {
429
- color: #b91c1c;
430
- background: #fff1f2;
431
- border-color: #ef4444;
432
- box-shadow: 0 18rpx 32rpx rgb(239 68 68 / 20%);
433
- }
434
-
435
- .demo-style-anchor {
436
- border-color: #d7d9f2;
437
- border-style: solid;
438
- border-width: 2rpx;
439
- }
440
- </style>
@@ -1,169 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref } from 'wevu'
3
- import { wpi } from 'wevu/api'
4
-
5
- import SectionTitle from '@/components/SectionTitle/index.vue'
6
- import { resolveBooleanChangeValue, resolveNumberChangeValue, resolveStringChangeValue } from '@/utils/changeEvent'
7
-
8
- definePageJson({
9
- navigationBarTitleText: '组件实验室',
10
- backgroundColor: '#f6f7fb',
11
- })
12
-
13
- const activeTab = ref('base')
14
- const rating = ref(4)
15
- const progress = ref(68)
16
- const slider = ref(42)
17
- const toggle = ref(true)
18
-
19
- const progressValue = computed(() => (Number.isFinite(progress.value) ? progress.value : 0))
20
-
21
- const tabs = [
22
- { value: 'base', label: '基础' },
23
- { value: 'feedback', label: '反馈' },
24
- { value: 'display', label: '展示' },
25
- ]
26
-
27
- function handleTabChange(event: unknown) {
28
- activeTab.value = resolveStringChangeValue(event, activeTab.value)
29
- }
30
-
31
- function handleRateChange(event: unknown) {
32
- rating.value = resolveNumberChangeValue(event, rating.value)
33
- }
34
-
35
- function handleSliderChange(event: unknown) {
36
- slider.value = resolveNumberChangeValue(event, slider.value)
37
- }
38
-
39
- function handleToggleChange(event: unknown) {
40
- toggle.value = resolveBooleanChangeValue(event, !toggle.value)
41
- }
42
-
43
- async function navigateTo(url: string) {
44
- await wpi.navigateTo({
45
- url,
46
- })
47
- }
48
- </script>
49
-
50
- <template>
51
- <view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
52
- <view class="rounded-[28rpx] bg-linear-to-br from-[#f5f3ff] via-[#ffffff] to-[#eef2ff] p-[20rpx]">
53
- <SectionTitle title="TDesign 组件实验室" subtitle="常用组件的组合应用" />
54
- <view class="mt-[12rpx]">
55
- <t-tabs :value="activeTab" @change="handleTabChange">
56
- <t-tab-panel v-for="tab in tabs" :key="tab.value" :value="tab.value" :label="tab.label" />
57
- </t-tabs>
58
- </view>
59
- </view>
60
-
61
- <view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
62
- <view v-if="activeTab === 'base'" class="space-y-[14rpx]">
63
- <SectionTitle title="基础组件" subtitle="标签、徽标、头像" />
64
- <view class="flex flex-wrap gap-[10rpx]">
65
- <t-tag theme="primary" variant="light">
66
- 新品
67
- </t-tag>
68
- <t-tag theme="warning" variant="light">
69
- 加急
70
- </t-tag>
71
- <t-tag theme="success" variant="light">
72
- 已完成
73
- </t-tag>
74
- <t-tag theme="default" variant="outline">
75
- 低风险
76
- </t-tag>
77
- </view>
78
- <view class="flex items-center gap-[14rpx]">
79
- <t-badge count="8">
80
- <t-avatar size="small" shape="round">
81
- A
82
- </t-avatar>
83
- </t-badge>
84
- <t-badge count="new">
85
- <t-avatar size="small" shape="round">
86
- B
87
- </t-avatar>
88
- </t-badge>
89
- <t-avatar-group :max="3" size="small">
90
- <t-avatar>U1</t-avatar>
91
- <t-avatar>U2</t-avatar>
92
- <t-avatar>U3</t-avatar>
93
- <t-avatar>U4</t-avatar>
94
- </t-avatar-group>
95
- </view>
96
- <view class="rounded-[18rpx] bg-[#f7f7fb] p-[16rpx]">
97
- <SectionTitle title="Vue 模板语法" subtitle="class 绑定、对象/数组语法" />
98
- <view class="mt-[8rpx]">
99
- <t-cell-group>
100
- <t-cell title="Class 绑定实验室" note="子包:/subpackages/lab/class-binding" arrow @tap="navigateTo('/subpackages/lab/class-binding/index')" />
101
- <t-cell title="virtualHost class 透传实验" note="子包:/subpackages/lab/virtual-host-class" arrow @tap="navigateTo('/subpackages/lab/virtual-host-class/index')" />
102
- </t-cell-group>
103
- </view>
104
- </view>
105
- </view>
106
-
107
- <view v-else-if="activeTab === 'feedback'" class="space-y-[14rpx]">
108
- <SectionTitle title="反馈组件" subtitle="进度、评分、滑块" />
109
- <t-progress :percentage="progressValue" status="active" stroke-width="8" />
110
- <view class="flex items-center justify-between">
111
- <text class="text-[22rpx] text-[#6f6b8a]">
112
- 满意度评分
113
- </text>
114
- <t-rate :value="rating" @change="handleRateChange" />
115
- </view>
116
- <view class="flex items-center justify-between">
117
- <text class="text-[22rpx] text-[#6f6b8a]">
118
- 阈值调整
119
- </text>
120
- <view class="flex items-center gap-[12rpx]">
121
- <t-slider :value="slider" @change="handleSliderChange" />
122
- <text class="text-[22rpx] text-[#6f6b8a]">
123
- {{ slider }}%
124
- </text>
125
- </view>
126
- </view>
127
- <view class="flex items-center justify-between">
128
- <text class="text-[22rpx] text-[#6f6b8a]">
129
- 自动提醒
130
- </text>
131
- <t-switch :value="toggle" @change="handleToggleChange" />
132
- </view>
133
- </view>
134
-
135
- <view v-else class="space-y-[14rpx]">
136
- <SectionTitle title="展示组件" subtitle="提示、轮播、二维码" />
137
- <t-notice-bar theme="info" content="TDesign 组件可用于丰富产品体验。" />
138
- <t-swiper :autoplay="true" height="140">
139
- <t-swiper-item>
140
- <view class="h-full rounded-[20rpx] bg-linear-to-br from-[#c7d2fe] to-[#f0abfc] p-[16rpx]">
141
- <text class="text-[24rpx] font-semibold text-white">
142
- 品牌展示
143
- </text>
144
- <text class="mt-[6rpx] block text-[20rpx] text-white/80">
145
- 适合做活动横幅
146
- </text>
147
- </view>
148
- </t-swiper-item>
149
- <t-swiper-item>
150
- <view class="h-full rounded-[20rpx] bg-linear-to-br from-[#fde68a] to-[#fca5a5] p-[16rpx]">
151
- <text class="text-[24rpx] font-semibold text-white">
152
- 营销推荐
153
- </text>
154
- <text class="mt-[6rpx] block text-[20rpx] text-white/80">
155
- 支持多色主题
156
- </text>
157
- </view>
158
- </t-swiper-item>
159
- </t-swiper>
160
- <view class="flex items-center justify-between">
161
- <text class="text-[22rpx] text-[#6f6b8a]">
162
- 扫码体验
163
- </text>
164
- <t-qrcode value="https://vite.icebreaker.top" :size="90" />
165
- </view>
166
- </view>
167
- </view>
168
- </view>
169
- </template>