create-weapp-vite 2.3.15 → 2.3.17

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 (74) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/{src-D8uqfCKh.js → src-DUTngca4.js} +4 -4
  4. package/package.json +1 -1
  5. package/templates/default/.vscode/settings.json +2 -1
  6. package/templates/lib/.vscode/settings.json +2 -1
  7. package/templates/lib/package.json +1 -1
  8. package/templates/tailwindcss/.vscode/settings.json +2 -1
  9. package/templates/tdesign/.vscode/settings.json +2 -1
  10. package/templates/vant/.vscode/settings.json +2 -1
  11. package/templates/wevu/.vscode/settings.json +2 -1
  12. package/templates/wevu/README.md +3 -3
  13. package/templates/wevu/package.json +1 -1
  14. package/templates/wevu/src/app.vue +1 -60
  15. package/templates/wevu/src/pages/index/index.vue +26 -194
  16. package/templates/wevu/src/pages/layouts/index.vue +0 -18
  17. package/templates/wevu/weapp-vite.config.ts +0 -7
  18. package/templates/wevu-tdesign/.vscode/settings.json +2 -1
  19. package/templates/wevu-tdesign/README.md +3 -6
  20. package/templates/wevu-tdesign/package.json +1 -1
  21. package/templates/wevu-tdesign/project.private.config.json +0 -66
  22. package/templates/wevu-tdesign/src/app.vue +1 -73
  23. package/templates/wevu-tdesign/src/pages/index/index.vue +19 -362
  24. package/templates/wevu/src/components/InfoPanel/index.vue +0 -52
  25. package/templates/wevu/src/components/StatusPill/index.vue +0 -42
  26. package/templates/wevu/src/packageA/pages/workspace/index.vue +0 -137
  27. package/templates/wevu/src/packageB/pages/settings/index.vue +0 -131
  28. package/templates/wevu/src/pages/overview/index.vue +0 -149
  29. package/templates/wevu-tdesign/public/tabbar/ability-active.png +0 -0
  30. package/templates/wevu-tdesign/public/tabbar/ability.png +0 -0
  31. package/templates/wevu-tdesign/public/tabbar/data-active.png +0 -0
  32. package/templates/wevu-tdesign/public/tabbar/data.png +0 -0
  33. package/templates/wevu-tdesign/public/tabbar/form-active.png +0 -0
  34. package/templates/wevu-tdesign/public/tabbar/form.png +0 -0
  35. package/templates/wevu-tdesign/public/tabbar/home-active.png +0 -0
  36. package/templates/wevu-tdesign/public/tabbar/home.png +0 -0
  37. package/templates/wevu-tdesign/public/tabbar/list-active.png +0 -0
  38. package/templates/wevu-tdesign/public/tabbar/list.png +0 -0
  39. package/templates/wevu-tdesign/src/components/EmptyState/index.vue +0 -36
  40. package/templates/wevu-tdesign/src/components/FilterBar/index.vue +0 -64
  41. package/templates/wevu-tdesign/src/components/FormRow/index.vue +0 -43
  42. package/templates/wevu-tdesign/src/components/FormStep/index.vue +0 -48
  43. package/templates/wevu-tdesign/src/components/KpiBoard/index.vue +0 -145
  44. package/templates/wevu-tdesign/src/components/QuickActionGrid/index.vue +0 -79
  45. package/templates/wevu-tdesign/src/components/ResultCard/index.vue +0 -51
  46. package/templates/wevu-tdesign/src/components/SectionTitle/index.vue +0 -34
  47. package/templates/wevu-tdesign/src/components/TrendCard/index.vue +0 -101
  48. package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/BrokenCard.vue +0 -46
  49. package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/FixedExternalClassCard.vue +0 -50
  50. package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/RecommendedCard.vue +0 -53
  51. package/templates/wevu-tdesign/src/hooks/useDialog.ts +0 -205
  52. package/templates/wevu-tdesign/src/hooks/useFormBinder.ts +0 -17
  53. package/templates/wevu-tdesign/src/hooks/useLayoutFeedbackBridge.ts +0 -17
  54. package/templates/wevu-tdesign/src/hooks/usePullDownRefresh.ts +0 -12
  55. package/templates/wevu-tdesign/src/hooks/useToast.ts +0 -100
  56. package/templates/wevu-tdesign/src/layouts/admin.vue +0 -41
  57. package/templates/wevu-tdesign/src/layouts/default.vue +0 -23
  58. package/templates/wevu-tdesign/src/pages/ability/index.vue +0 -164
  59. package/templates/wevu-tdesign/src/pages/data/index.vue +0 -189
  60. package/templates/wevu-tdesign/src/pages/form/index.vue +0 -271
  61. package/templates/wevu-tdesign/src/pages/layout-feedback/components/FeedbackCallerCard.vue +0 -79
  62. package/templates/wevu-tdesign/src/pages/layout-feedback/index.vue +0 -211
  63. package/templates/wevu-tdesign/src/pages/layout-store/index.vue +0 -127
  64. package/templates/wevu-tdesign/src/pages/layouts/index.vue +0 -120
  65. package/templates/wevu-tdesign/src/pages/list/index.vue +0 -146
  66. package/templates/wevu-tdesign/src/stores/layoutInteractionDemo.ts +0 -129
  67. package/templates/wevu-tdesign/src/subpackages/ability/index.vue +0 -103
  68. package/templates/wevu-tdesign/src/subpackages/lab/class-binding/index.vue +0 -440
  69. package/templates/wevu-tdesign/src/subpackages/lab/index.vue +0 -169
  70. package/templates/wevu-tdesign/src/subpackages/lab/virtual-host-class/index.vue +0 -94
  71. package/templates/wevu-tdesign/src/types/action.ts +0 -14
  72. package/templates/wevu-tdesign/src/types/list.ts +0 -17
  73. package/templates/wevu-tdesign/src/utils/changeEvent.ts +0 -53
  74. package/templates/wevu-tdesign/src/utils/listFilters.ts +0 -34
@@ -1,90 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { onHide, onLaunch, onShow } from 'wevu'
3
- import { wpi } from 'wevu/api'
4
-
5
2
  defineAppJson({
6
3
  pages: [
7
4
  'pages/index/index',
8
- 'pages/layouts/index',
9
- 'pages/layout-store/index',
10
- 'pages/layout-feedback/index',
11
- 'pages/data/index',
12
- 'pages/form/index',
13
- 'pages/list/index',
14
- 'pages/ability/index',
15
5
  ],
16
6
  window: {
17
- navigationBarTitleText: 'Weapp Studio',
7
+ navigationBarTitleText: 'TDesign 模板',
18
8
  navigationBarBackgroundColor: '#2f2b5f',
19
9
  navigationBarTextStyle: 'white',
20
10
  backgroundTextStyle: 'dark',
21
11
  },
22
- tabBar: {
23
- color: '#7a7aa0',
24
- selectedColor: '#2f2b5f',
25
- backgroundColor: '#ffffff',
26
- borderStyle: 'white',
27
- list: [
28
- {
29
- pagePath: 'pages/index/index',
30
- text: '首页',
31
- iconPath: 'tabbar/home.png',
32
- selectedIconPath: 'tabbar/home-active.png',
33
- },
34
- {
35
- pagePath: 'pages/data/index',
36
- text: '数据',
37
- iconPath: 'tabbar/data.png',
38
- selectedIconPath: 'tabbar/data-active.png',
39
- },
40
- {
41
- pagePath: 'pages/form/index',
42
- text: '表单',
43
- iconPath: 'tabbar/form.png',
44
- selectedIconPath: 'tabbar/form-active.png',
45
- },
46
- {
47
- pagePath: 'pages/list/index',
48
- text: '清单',
49
- iconPath: 'tabbar/list.png',
50
- selectedIconPath: 'tabbar/list-active.png',
51
- },
52
- {
53
- pagePath: 'pages/ability/index',
54
- text: '能力',
55
- iconPath: 'tabbar/ability.png',
56
- selectedIconPath: 'tabbar/ability-active.png',
57
- },
58
- ],
59
- },
60
- subPackages: [
61
- {
62
- root: 'subpackages/lab',
63
- pages: ['index', 'class-binding/index', 'virtual-host-class/index'],
64
- },
65
- {
66
- root: 'subpackages/ability',
67
- pages: ['index'],
68
- },
69
- ],
70
12
  style: 'v2',
71
13
  componentFramework: 'glass-easel',
72
14
  sitemapLocation: 'sitemap.json',
73
15
  })
74
-
75
- const logger = wpi.getLogManager({ level: 1 })
76
-
77
- onShow(() => {
78
- logger.info('[weapp-vite-wevu-template] app show')
79
- })
80
-
81
- onHide(() => {
82
- logger.info('[weapp-vite-wevu-template] app hide')
83
- })
84
-
85
- onLaunch(() => {
86
- logger.info('[weapp-vite-wevu-template] app launch')
87
- })
88
16
  </script>
89
17
 
90
18
  <style src="./app.css"></style>
@@ -1,380 +1,37 @@
1
1
  <script setup lang="ts">
2
- import type { QuickActionItem } from '@/types/action'
3
-
4
- import { computed, getCurrentInstance, ref, resolveLayoutBridge, resolveLayoutHost, watch } from 'wevu'
5
- import { wpi } from 'wevu/api'
6
- import KpiBoard from '@/components/KpiBoard/index.vue'
7
- import QuickActionGrid from '@/components/QuickActionGrid/index.vue'
8
- import { LAYOUT_TOAST_BRIDGE_KEY } from '@/hooks/useLayoutFeedbackBridge'
9
- import { usePullDownRefresh } from '@/hooks/usePullDownRefresh'
10
- import { useToast } from '@/hooks/useToast'
2
+ import { computed, ref } from 'wevu'
11
3
 
12
4
  definePageJson({
13
- navigationBarTitleText: '首页',
14
- enablePullDownRefresh: true,
5
+ navigationBarTitleText: 'TDesign 模板',
15
6
  backgroundColor: '#f6f7fb',
16
7
  })
17
8
 
18
- const { showToast } = useToast()
19
- const pageInstance = getCurrentInstance<any>()
20
-
21
- const noticeText = ref('欢迎体验 wevu + weapp-vite + TDesign 模板,已启用分包与多页面导航。')
22
- const lastUpdated = ref('刚刚')
23
- const refreshSeed = ref(1)
24
-
25
- const kpiItems = computed(() => {
26
- const seed = refreshSeed.value
27
- return [
28
- {
29
- key: 'visits',
30
- label: '今日访问',
31
- value: 1280 + seed * 3,
32
- unit: '次',
33
- delta: 6 + seed,
34
- footnote: '较昨日',
35
- },
36
- {
37
- key: 'conversion',
38
- label: '转化率',
39
- value: 24 + seed,
40
- unit: '%',
41
- delta: 2,
42
- footnote: '近 7 日',
43
- },
44
- {
45
- key: 'tickets',
46
- label: '待处理',
47
- value: 18 - seed,
48
- unit: '单',
49
- delta: -1,
50
- footnote: '来自清单',
51
- },
52
- {
53
- key: 'satisfaction',
54
- label: '满意度',
55
- value: 4.8,
56
- unit: '分',
57
- delta: 0.2,
58
- footnote: '客服评分',
59
- },
60
- ]
61
- })
62
-
63
- const quickActions = ref<QuickActionItem[]>([
64
- {
65
- key: 'data',
66
- title: '数据洞察',
67
- description: '仪表盘与趋势',
68
- icon: 'chart-analytics',
69
- tag: 'KPI',
70
- tone: 'brand',
71
- path: '/pages/data/index',
72
- type: 'tab',
73
- },
74
- {
75
- key: 'form',
76
- title: '流程表单',
77
- description: '多步录入',
78
- icon: 'edit-1',
79
- tag: 'Flow',
80
- tone: 'neutral',
81
- path: '/pages/form/index',
82
- type: 'tab',
83
- },
84
- {
85
- key: 'list',
86
- title: '清单看板',
87
- description: '筛选与列表',
88
- icon: 'view-list',
89
- tag: 'List',
90
- tone: 'neutral',
91
- path: '/pages/list/index',
92
- type: 'tab',
93
- },
94
- {
95
- key: 'ability',
96
- title: '能力中心',
97
- description: '小程序 API',
98
- icon: 'app',
99
- tag: 'API',
100
- tone: 'brand',
101
- path: '/pages/ability/index',
102
- type: 'tab',
103
- },
104
- {
105
- key: 'layouts',
106
- title: '布局能力',
107
- description: 'default / admin / false',
108
- icon: 'layers',
109
- tag: 'Layout',
110
- tone: 'brand',
111
- path: '/pages/layouts/index',
112
- type: 'sub',
113
- },
114
- {
115
- key: 'layout-feedback',
116
- title: 'Layout 通信',
117
- description: '页面/组件调用 layout',
118
- icon: 'chat-bubble',
119
- tag: 'Bridge',
120
- tone: 'brand',
121
- path: '/pages/layout-feedback/index',
122
- type: 'sub',
123
- },
124
- {
125
- key: 'layout-store',
126
- title: 'Store 调用 Layout',
127
- description: 'store 驱动 layout 宿主',
128
- icon: 'layers',
129
- tag: 'Store',
130
- tone: 'brand',
131
- path: '/pages/layout-store/index',
132
- type: 'sub',
133
- },
134
- {
135
- key: 'lab',
136
- title: '组件实验室',
137
- description: 'TDesign 组件',
138
- icon: 'grid-view',
139
- tag: 'Lab',
140
- tone: 'neutral',
141
- path: '/subpackages/lab/index',
142
- type: 'sub',
143
- },
144
- {
145
- key: 'class-binding',
146
- title: 'Class 绑定',
147
- description: '对象/数组语法',
148
- icon: 'grid-view',
149
- tag: 'Vue',
150
- tone: 'brand',
151
- path: '/subpackages/lab/class-binding/index',
152
- type: 'sub',
153
- },
154
- {
155
- key: 'ability-lab',
156
- title: 'API 场景',
157
- description: '系统信息',
158
- icon: 'share',
159
- tag: 'Sub',
160
- tone: 'neutral',
161
- path: '/subpackages/ability/index',
162
- type: 'sub',
163
- },
164
- ])
165
-
166
- const featureTags = [
167
- 'Composition API',
168
- 'SubPackages',
169
- 'Auto Import',
170
- 'Tailwind',
171
- ]
172
-
173
- watch(refreshSeed, () => {
174
- lastUpdated.value = `更新于 ${new Date().toLocaleTimeString()}`
175
- })
176
-
177
- function nextRefreshSeedValue() {
178
- return refreshSeed.value >= 9 ? 1 : refreshSeed.value + 1
179
- }
180
-
181
- function refreshDashboard() {
182
- refreshSeed.value = nextRefreshSeedValue()
183
- showToast('指标已刷新')
184
- }
185
-
186
- function inspectLayoutToastBridge() {
187
- const bridge = resolveLayoutBridge(LAYOUT_TOAST_BRIDGE_KEY, pageInstance)
188
- const layoutByPage = pageInstance?.selectComponent?.('weapp-layout-default')
189
- ?? pageInstance?.selectComponent?.('.weapp-layout-default')
190
- ?? null
191
- const toastFromBridge = resolveLayoutHost(LAYOUT_TOAST_BRIDGE_KEY, { context: pageInstance })
192
-
193
- return {
194
- bridgeResolved: Boolean(bridge),
195
- bridgeIsPage: bridge === pageInstance,
196
- bridgeHasSelectComponent: typeof bridge?.selectComponent === 'function',
197
- layoutFoundByPage: Boolean(layoutByPage),
198
- toastFoundByBridge: Boolean(toastFromBridge),
199
- bridgeKeys: bridge ? Object.keys(bridge).slice(0, 20) : [],
200
- layoutKeys: layoutByPage ? Object.keys(layoutByPage).slice(0, 20) : [],
201
- }
202
- }
203
-
204
- void inspectLayoutToastBridge
205
-
206
- function runLayoutToastE2E() {
207
- refreshSeed.value = nextRefreshSeedValue()
208
- const bridgeState = inspectLayoutToastBridge()
209
- setTimeout(() => {
210
- showToast('指标已刷新')
211
- }, 0)
212
- return {
213
- ...bridgeState,
214
- refreshSeed: refreshSeed.value,
215
- }
216
- }
217
-
218
- void runLayoutToastE2E
219
-
220
- usePullDownRefresh(refreshDashboard)
221
-
222
- async function onQuickAction(action: QuickActionItem) {
223
- if (!action.path) {
224
- showToast('该入口暂未配置')
225
- return
226
- }
227
- if (action.type === 'tab') {
228
- await wpi.switchTab({
229
- url: action.path,
230
- })
231
- return
232
- }
233
- await wpi.navigateTo({
234
- url: action.path,
235
- })
236
- }
9
+ const count = ref(0)
10
+ const buttonText = computed(() => `已点击 ${count.value} 次`)
237
11
  </script>
238
12
 
239
13
  <template>
240
- <view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[32rpx] text-[#1c1c3c]">
241
- <view class="rounded-[28rpx] bg-linear-to-br from-[#2f2b5f] via-[#3b3573] to-[#5a48c5] p-[24rpx] text-white shadow-[0_24rpx_48rpx_rgba(47,43,95,0.35)]">
242
- <text class="text-[38rpx] font-semibold">
243
- Weapp Studio
244
- </text>
245
- <text class="mt-[8rpx] block text-[22rpx] text-white/80">
246
- 以场景驱动的模板,展示 wevu、weapp-vite 与 TDesign。
247
- </text>
248
- <view class="mt-[12rpx] flex flex-wrap gap-[8rpx]">
249
- <t-tag v-for="tag in featureTags" :key="tag" size="small" theme="primary" variant="dark">
250
- {{ tag }}
251
- </t-tag>
14
+ <view class="min-h-screen bg-[#f6f7fb] px-[28rpx] py-[32rpx] text-[#1f1a3f]">
15
+ <view class="rounded-[28rpx] bg-white p-[28rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
16
+ <t-tag theme="primary" variant="light">
17
+ wevu
18
+ </t-tag>
19
+ <view class="mt-[16rpx] text-[38rpx] font-semibold">
20
+ TDesign 最小模板
252
21
  </view>
253
- <view class="mt-[16rpx] flex items-center justify-between">
254
- <text class="text-[20rpx] text-white/70">
255
- {{ lastUpdated }}
256
- </text>
257
- <view id="refresh-dashboard-trigger" @tap="refreshDashboard">
258
- <t-button size="small" theme="default" variant="outline">
259
- 刷新指标
260
- </t-button>
261
- </view>
22
+ <view class="mt-[12rpx] text-[24rpx] leading-[1.6] text-[#64748b]">
23
+ 保留 Vue SFC、Tailwind CSS 与 TDesign 自动导入的最小组合,复杂验证场景已迁到 e2e-apps。
262
24
  </view>
263
- </view>
264
-
265
- <view class="mt-[16rpx]">
266
- <t-notice-bar theme="info" :content="noticeText" />
267
- </view>
268
-
269
- <view class="mt-[20rpx]">
270
- <KpiBoard title="今日概览" subtitle="实时跟踪业务健康度" :items="kpiItems">
271
- <template #action>
272
- <t-button size="small" theme="primary" variant="outline" @tap="refreshDashboard">
273
- 重新计算
274
- </t-button>
275
- </template>
276
- <template #items="{ items }">
277
- <view v-for="card in items" :key="card.key" class="rounded-[18rpx] bg-[#f4f6ff] p-[16rpx]">
278
- <view class="flex items-center justify-between">
279
- <text class="text-[22rpx] text-[#51517c]">
280
- {{ card.item.label }}
281
- </text>
282
- <t-tag v-if="card.isLeading" size="small" theme="warning" variant="light">
283
- 热点
284
- </t-tag>
285
- </view>
286
- <view class="mt-[12rpx] flex items-end justify-between">
287
- <view class="flex items-baseline gap-[6rpx]">
288
- <text class="text-[32rpx] font-semibold text-[#1f1a3f]">
289
- {{ card.item.value }}
290
- </text>
291
- <text v-if="card.item.unit" class="text-[20rpx] text-[#7a7aa0]">
292
- {{ card.item.unit }}
293
- </text>
294
- </view>
295
- <text
296
- class="text-[20rpx] font-semibold"
297
- :class="card.tone === 'positive' ? 'text-[#1b7a3a]' : card.tone === 'negative' ? 'text-[#b42318]' : 'text-[#64748b]'"
298
- >
299
- {{ card.tone === 'positive' ? '↑' : card.tone === 'negative' ? '↓' : '→' }}
300
- {{ card.item.delta ?? '--' }}
301
- </text>
302
- </view>
303
- <text v-if="card.item.footnote" class="mt-[6rpx] block text-[20rpx] text-[#7a7aa0]">
304
- {{ card.item.footnote }}
305
- </text>
306
- </view>
307
- </template>
308
- </KpiBoard>
309
- </view>
310
25
 
311
- <view class="mt-[20rpx]">
312
- <QuickActionGrid
313
- title="快速入口"
314
- subtitle="覆盖主包与分包页面"
315
- :items="quickActions"
316
- @select="onQuickAction"
317
- />
318
- </view>
319
-
320
- <view class="mt-[20rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
321
- <view class="flex items-center justify-between">
322
- <text class="text-[26rpx] font-semibold text-[#1f1a3f]">
323
- Class 绑定示例
26
+ <view class="mt-[24rpx] rounded-[20rpx] bg-[#f4f6ff] p-[20rpx]">
27
+ <text class="text-[24rpx] text-[#51517c]">
28
+ {{ buttonText }}
324
29
  </text>
325
- <t-tag size="small" theme="primary" variant="light">
326
- 模板
327
- </t-tag>
328
30
  </view>
329
- <view class="mt-[12rpx] flex flex-col gap-[12rpx]">
330
- <view
331
- class="rounded-[16rpx] px-[16rpx] py-[12rpx] text-[20rpx]"
332
- :class="{
333
- 'bg-[#eef2ff]': refreshSeed % 2 === 0,
334
- 'text-[#1f1a3f]': refreshSeed % 2 === 0,
335
- 'bg-[#fff7ed]': refreshSeed % 2 !== 0,
336
- 'text-[#92400e]': refreshSeed % 2 !== 0,
337
- 'ring-2 ring-[#6366f1]': refreshSeed % 3 === 0,
338
- }"
339
- >
340
- 对象语法:根据刷新次数切换配色与高亮
341
- </view>
342
- <view
343
- class="rounded-[16rpx] px-[16rpx] py-[12rpx] text-[20rpx]" :class="[
344
- refreshSeed % 2 === 0 ? 'bg-[#ecfeff] text-[#0f766e]' : 'bg-[#fef2f2] text-[#991b1b]',
345
- refreshSeed % 4 === 0
346
- ? 'shadow-[0_10rpx_18rpx_rgba(15,118,110,0.18)]'
347
- : 'shadow-[0_10rpx_18rpx_rgba(153,27,27,0.18)]',
348
- ]"
349
- >
350
- 数组语法:组合静态与条件 class
351
- </view>
352
- <view
353
- class="rounded-[16rpx] border border-[#e2e8f0] px-[16rpx] py-[12rpx] text-[20rpx]"
354
- :class="refreshSeed % 2 === 0 ? 'bg-[#f8fafc] text-[#334155]' : 'bg-[#111827] text-white'"
355
- >
356
- class + :class 合并:静态边框叠加动态背景
357
- </view>
358
- </view>
359
- </view>
360
31
 
361
- <view class="mt-[20rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
362
- <view class="flex items-center justify-between">
363
- <text class="text-[26rpx] font-semibold text-[#1f1a3f]">
364
- 体验清单
365
- </text>
366
- <t-tag size="small" theme="primary" variant="light">
367
- 指南
368
- </t-tag>
369
- </view>
370
- <view class="mt-[12rpx]">
371
- <t-cell-group>
372
- <t-cell title="多页面 TabBar" note="首页/数据/表单/清单/能力" />
373
- <t-cell title="分包加载" note="组件实验室与 API 场景" />
374
- <t-cell title="Composition API" note="ref/computed/watch 驱动" />
375
- <t-cell title="TDesign 组件" note="表单、列表、反馈" />
376
- </t-cell-group>
377
- </view>
32
+ <t-button class="mt-[24rpx]" theme="primary" block @tap="count += 1">
33
+ 点一下
34
+ </t-button>
378
35
  </view>
379
36
  </view>
380
37
  </template>
@@ -1,52 +0,0 @@
1
- <script setup lang="ts">
2
- withDefaults(defineProps<{
3
- eyebrow?: string
4
- title: string
5
- description: string
6
- }>(), {})
7
- </script>
8
-
9
- <template>
10
- <view class="feature">
11
- <view v-if="eyebrow" class="feature__eyebrow">
12
- {{ eyebrow }}
13
- </view>
14
- <view class="feature__title">
15
- {{ title }}
16
- </view>
17
- <view class="feature__desc">
18
- {{ description }}
19
- </view>
20
- </view>
21
- </template>
22
-
23
- <style>
24
- .feature {
25
- padding: 24rpx;
26
- background: #fff;
27
- border: 2rpx solid #e2e8f0;
28
- border-radius: 24rpx;
29
- box-shadow: 0 10rpx 30rpx rgb(15 23 42 / 4%);
30
- }
31
-
32
- .feature__eyebrow {
33
- font-size: 20rpx;
34
- font-weight: 600;
35
- color: #64748b;
36
- letter-spacing: 1rpx;
37
- }
38
-
39
- .feature__title {
40
- margin-top: 8rpx;
41
- font-size: 26rpx;
42
- font-weight: 700;
43
- color: #0f172a;
44
- }
45
-
46
- .feature__desc {
47
- margin-top: 8rpx;
48
- font-size: 24rpx;
49
- line-height: 1.6;
50
- color: #64748b;
51
- }
52
- </style>
@@ -1,42 +0,0 @@
1
- <script setup lang="ts">
2
- withDefaults(defineProps<{
3
- label: string
4
- tone?: 'neutral' | 'accent' | 'success'
5
- }>(), {
6
- tone: 'neutral',
7
- })
8
- </script>
9
-
10
- <template>
11
- <view class="badge" :class="`badge--${tone}`">
12
- {{ label }}
13
- </view>
14
- </template>
15
-
16
- <style>
17
- .badge {
18
- display: inline-flex;
19
- align-items: center;
20
- justify-content: center;
21
- min-width: 120rpx;
22
- padding: 12rpx 22rpx;
23
- font-size: 22rpx;
24
- font-weight: 600;
25
- border-radius: 999rpx;
26
- }
27
-
28
- .badge--neutral {
29
- color: #475569;
30
- background: #e2e8f0;
31
- }
32
-
33
- .badge--accent {
34
- color: #155eef;
35
- background: #dbeafe;
36
- }
37
-
38
- .badge--success {
39
- color: #047857;
40
- background: #d1fae5;
41
- }
42
- </style>