create-weapp-vite 2.3.14 → 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.
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-JolaD7Ia.js → src-C8kzMXK7.js} +11 -7
- package/package.json +1 -1
- package/templates/default/.vscode/extensions.json +2 -1
- package/templates/default/package.json +3 -0
- package/templates/lib/.vscode/extensions.json +2 -1
- package/templates/lib/package.json +4 -1
- package/templates/plugin/.vscode/extensions.json +7 -0
- package/templates/plugin/package.json +3 -0
- package/templates/tailwindcss/.vscode/extensions.json +2 -1
- package/templates/tailwindcss/package.json +3 -0
- package/templates/tdesign/.vscode/extensions.json +2 -1
- package/templates/tdesign/package.json +3 -0
- package/templates/vant/.vscode/extensions.json +2 -1
- package/templates/vant/package.json +3 -0
- package/templates/wevu/.vscode/extensions.json +2 -1
- package/templates/wevu/README.md +3 -3
- package/templates/wevu/package.json +4 -1
- package/templates/wevu/src/app.vue +1 -60
- package/templates/wevu/src/pages/index/index.vue +26 -194
- package/templates/wevu/src/pages/layouts/index.vue +0 -18
- package/templates/wevu/weapp-vite.config.ts +0 -7
- package/templates/wevu-tdesign/.vscode/extensions.json +2 -1
- package/templates/wevu-tdesign/README.md +3 -6
- package/templates/wevu-tdesign/package.json +4 -1
- package/templates/wevu-tdesign/project.private.config.json +0 -66
- package/templates/wevu-tdesign/src/app.vue +1 -73
- package/templates/wevu-tdesign/src/pages/index/index.vue +19 -362
- package/templates/wevu/src/components/InfoPanel/index.vue +0 -52
- package/templates/wevu/src/components/StatusPill/index.vue +0 -42
- package/templates/wevu/src/packageA/pages/workspace/index.vue +0 -137
- package/templates/wevu/src/packageB/pages/settings/index.vue +0 -131
- package/templates/wevu/src/pages/overview/index.vue +0 -149
- package/templates/wevu-tdesign/public/tabbar/ability-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/ability.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/data-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/data.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/form-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/form.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/home-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/home.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/list-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/list.png +0 -0
- package/templates/wevu-tdesign/src/components/EmptyState/index.vue +0 -36
- package/templates/wevu-tdesign/src/components/FilterBar/index.vue +0 -64
- package/templates/wevu-tdesign/src/components/FormRow/index.vue +0 -43
- package/templates/wevu-tdesign/src/components/FormStep/index.vue +0 -48
- package/templates/wevu-tdesign/src/components/KpiBoard/index.vue +0 -145
- package/templates/wevu-tdesign/src/components/QuickActionGrid/index.vue +0 -79
- package/templates/wevu-tdesign/src/components/ResultCard/index.vue +0 -51
- package/templates/wevu-tdesign/src/components/SectionTitle/index.vue +0 -34
- package/templates/wevu-tdesign/src/components/TrendCard/index.vue +0 -101
- package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/BrokenCard.vue +0 -46
- package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/FixedExternalClassCard.vue +0 -50
- package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/RecommendedCard.vue +0 -53
- package/templates/wevu-tdesign/src/hooks/useDialog.ts +0 -205
- package/templates/wevu-tdesign/src/hooks/useFormBinder.ts +0 -17
- package/templates/wevu-tdesign/src/hooks/useLayoutFeedbackBridge.ts +0 -17
- package/templates/wevu-tdesign/src/hooks/usePullDownRefresh.ts +0 -12
- package/templates/wevu-tdesign/src/hooks/useToast.ts +0 -100
- package/templates/wevu-tdesign/src/layouts/admin.vue +0 -41
- package/templates/wevu-tdesign/src/layouts/default.vue +0 -23
- package/templates/wevu-tdesign/src/pages/ability/index.vue +0 -164
- package/templates/wevu-tdesign/src/pages/data/index.vue +0 -189
- package/templates/wevu-tdesign/src/pages/form/index.vue +0 -271
- package/templates/wevu-tdesign/src/pages/layout-feedback/components/FeedbackCallerCard.vue +0 -79
- package/templates/wevu-tdesign/src/pages/layout-feedback/index.vue +0 -211
- package/templates/wevu-tdesign/src/pages/layout-store/index.vue +0 -127
- package/templates/wevu-tdesign/src/pages/layouts/index.vue +0 -120
- package/templates/wevu-tdesign/src/pages/list/index.vue +0 -146
- package/templates/wevu-tdesign/src/stores/layoutInteractionDemo.ts +0 -129
- package/templates/wevu-tdesign/src/subpackages/ability/index.vue +0 -103
- package/templates/wevu-tdesign/src/subpackages/lab/class-binding/index.vue +0 -440
- package/templates/wevu-tdesign/src/subpackages/lab/index.vue +0 -169
- package/templates/wevu-tdesign/src/subpackages/lab/virtual-host-class/index.vue +0 -94
- package/templates/wevu-tdesign/src/types/action.ts +0 -14
- package/templates/wevu-tdesign/src/types/list.ts +0 -17
- package/templates/wevu-tdesign/src/utils/changeEvent.ts +0 -53
- package/templates/wevu-tdesign/src/utils/listFilters.ts +0 -34
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineOptions({
|
|
3
|
-
options: {
|
|
4
|
-
multipleSlots: true,
|
|
5
|
-
},
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
withDefaults(
|
|
9
|
-
defineProps<{
|
|
10
|
-
step: number
|
|
11
|
-
title: string
|
|
12
|
-
subtitle?: string
|
|
13
|
-
active?: boolean
|
|
14
|
-
}>(),
|
|
15
|
-
{
|
|
16
|
-
subtitle: '',
|
|
17
|
-
active: false,
|
|
18
|
-
},
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
defineComponentJson({
|
|
22
|
-
styleIsolation: 'apply-shared',
|
|
23
|
-
})
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<view class="rounded-[20rpx] bg-white p-[20rpx] shadow-[0_12rpx_28rpx_rgba(17,24,39,0.08)]">
|
|
28
|
-
<view class="flex items-center gap-[12rpx]">
|
|
29
|
-
<view
|
|
30
|
-
class="flex h-[36rpx] w-[36rpx] items-center justify-center rounded-full text-[20rpx] font-semibold"
|
|
31
|
-
:class="active ? 'bg-[#2f2b5f] text-white' : 'bg-[#eff1f6] text-[#5c5b7a]'"
|
|
32
|
-
>
|
|
33
|
-
{{ step }}
|
|
34
|
-
</view>
|
|
35
|
-
<view>
|
|
36
|
-
<text class="text-[26rpx] font-semibold text-[#1f1a3f]">
|
|
37
|
-
{{ title }}
|
|
38
|
-
</text>
|
|
39
|
-
<text v-if="subtitle" class="mt-[4rpx] block text-[20rpx] text-[#6f6b8a]">
|
|
40
|
-
{{ subtitle }}
|
|
41
|
-
</text>
|
|
42
|
-
</view>
|
|
43
|
-
</view>
|
|
44
|
-
<view class="mt-[16rpx]">
|
|
45
|
-
<slot />
|
|
46
|
-
</view>
|
|
47
|
-
</view>
|
|
48
|
-
</template>
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'wevu'
|
|
3
|
-
|
|
4
|
-
defineOptions({
|
|
5
|
-
options: {
|
|
6
|
-
multipleSlots: true,
|
|
7
|
-
},
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
const props = withDefaults(defineProps<{
|
|
11
|
-
title: string
|
|
12
|
-
subtitle?: string
|
|
13
|
-
items?: KpiItem[]
|
|
14
|
-
columns?: 2 | 3
|
|
15
|
-
}>(), {
|
|
16
|
-
subtitle: '',
|
|
17
|
-
items: () => [],
|
|
18
|
-
columns: 2,
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
type KpiTone = 'positive' | 'negative' | 'neutral'
|
|
22
|
-
|
|
23
|
-
export interface KpiItem {
|
|
24
|
-
key?: string
|
|
25
|
-
label: string
|
|
26
|
-
value: string | number
|
|
27
|
-
unit?: string
|
|
28
|
-
delta?: number
|
|
29
|
-
footnote?: string
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
defineComponentJson({
|
|
33
|
-
styleIsolation: 'apply-shared',
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
function resolveTone(delta?: number): KpiTone {
|
|
37
|
-
if (delta === undefined || Number.isNaN(delta)) {
|
|
38
|
-
return 'neutral'
|
|
39
|
-
}
|
|
40
|
-
if (delta > 0) {
|
|
41
|
-
return 'positive'
|
|
42
|
-
}
|
|
43
|
-
if (delta < 0) {
|
|
44
|
-
return 'negative'
|
|
45
|
-
}
|
|
46
|
-
return 'neutral'
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const cards = computed(() => {
|
|
50
|
-
const source = Array.isArray(props.items) ? props.items : []
|
|
51
|
-
return source.map((item, index) => ({
|
|
52
|
-
key: item.key ?? String(index),
|
|
53
|
-
item,
|
|
54
|
-
index,
|
|
55
|
-
tone: resolveTone(item.delta),
|
|
56
|
-
isLeading: index === 0,
|
|
57
|
-
}))
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const gridClass = computed(() => (props.columns === 3 ? 'grid-cols-3' : 'grid-cols-2'))
|
|
61
|
-
|
|
62
|
-
function formatDelta(delta?: number, unit = '') {
|
|
63
|
-
if (delta === undefined || Number.isNaN(delta)) {
|
|
64
|
-
return '--'
|
|
65
|
-
}
|
|
66
|
-
const sign = delta > 0 ? '+' : ''
|
|
67
|
-
return `${sign}${delta}${unit}`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function toneBadgeClass(tone: KpiTone) {
|
|
71
|
-
if (tone === 'positive') {
|
|
72
|
-
return 'bg-[#e7f7ee] text-[#1b7a3a]'
|
|
73
|
-
}
|
|
74
|
-
if (tone === 'negative') {
|
|
75
|
-
return 'bg-[#ffe9e9] text-[#b42318]'
|
|
76
|
-
}
|
|
77
|
-
return 'bg-[#edf1f7] text-[#64748b]'
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function toneDotClass(tone: KpiTone) {
|
|
81
|
-
if (tone === 'positive') {
|
|
82
|
-
return 'bg-[#22c55e]'
|
|
83
|
-
}
|
|
84
|
-
if (tone === 'negative') {
|
|
85
|
-
return 'bg-[#ef4444]'
|
|
86
|
-
}
|
|
87
|
-
return 'bg-[#94a3b8]'
|
|
88
|
-
}
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<template>
|
|
92
|
-
<view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
93
|
-
<view class="flex items-end justify-between">
|
|
94
|
-
<view>
|
|
95
|
-
<text class="text-[28rpx] font-semibold text-[#1f1a3f]">
|
|
96
|
-
{{ title }}
|
|
97
|
-
</text>
|
|
98
|
-
<text v-if="subtitle" class="mt-[6rpx] block text-[22rpx] text-[#6f6b8a]">
|
|
99
|
-
{{ subtitle }}
|
|
100
|
-
</text>
|
|
101
|
-
</view>
|
|
102
|
-
<slot name="action" />
|
|
103
|
-
</view>
|
|
104
|
-
<view class="mt-[16rpx] grid gap-[12rpx]" :class="gridClass">
|
|
105
|
-
<slot name="items" :items="cards">
|
|
106
|
-
<view v-for="card in cards" :key="card.key">
|
|
107
|
-
<view class="rounded-[18rpx] bg-[#f7f7fb] p-[16rpx]">
|
|
108
|
-
<view class="flex items-center justify-between">
|
|
109
|
-
<view class="flex items-center gap-[8rpx]">
|
|
110
|
-
<view class="h-[8rpx] w-[8rpx] rounded-full" :class="toneDotClass(card.tone)" />
|
|
111
|
-
<text class="text-[22rpx] text-[#61618a]">
|
|
112
|
-
{{ card.item.label }}
|
|
113
|
-
</text>
|
|
114
|
-
</view>
|
|
115
|
-
<view v-if="card.isLeading" class="rounded-full bg-[#fff3c2] px-[10rpx] py-[4rpx]">
|
|
116
|
-
<text class="text-[18rpx] font-semibold text-[#8a5200]">
|
|
117
|
-
HOT
|
|
118
|
-
</text>
|
|
119
|
-
</view>
|
|
120
|
-
</view>
|
|
121
|
-
<view class="mt-[10rpx] flex items-end justify-between">
|
|
122
|
-
<view class="flex items-baseline gap-[6rpx]">
|
|
123
|
-
<text class="text-[32rpx] font-bold text-[#1c1c3c]">
|
|
124
|
-
{{ card.item.value }}
|
|
125
|
-
</text>
|
|
126
|
-
<text v-if="card.item.unit" class="text-[20rpx] text-[#7a7aa0]">
|
|
127
|
-
{{ card.item.unit }}
|
|
128
|
-
</text>
|
|
129
|
-
</view>
|
|
130
|
-
<view class="rounded-full px-[10rpx] py-[4rpx]" :class="toneBadgeClass(card.tone)">
|
|
131
|
-
<text class="text-[20rpx] font-semibold">
|
|
132
|
-
{{ card.tone === 'positive' ? '↑' : card.tone === 'negative' ? '↓' : '→' }}
|
|
133
|
-
{{ formatDelta(card.item.delta, card.item.unit ?? '') }}
|
|
134
|
-
</text>
|
|
135
|
-
</view>
|
|
136
|
-
</view>
|
|
137
|
-
<text v-if="card.item.footnote" class="mt-[6rpx] block text-[20rpx] text-[#8a8aa5]">
|
|
138
|
-
{{ card.item.footnote }}
|
|
139
|
-
</text>
|
|
140
|
-
</view>
|
|
141
|
-
</view>
|
|
142
|
-
</slot>
|
|
143
|
-
</view>
|
|
144
|
-
</view>
|
|
145
|
-
</template>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { QuickActionItem } from '@/types/action'
|
|
3
|
-
|
|
4
|
-
import { computed } from 'wevu'
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
title: string
|
|
8
|
-
subtitle?: string
|
|
9
|
-
items?: QuickActionItem[]
|
|
10
|
-
}>(), {
|
|
11
|
-
subtitle: '',
|
|
12
|
-
items: () => [],
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
const emit = defineEmits<{
|
|
16
|
-
(e: 'select', item: QuickActionItem): void
|
|
17
|
-
}>()
|
|
18
|
-
|
|
19
|
-
defineComponentJson({
|
|
20
|
-
styleIsolation: 'apply-shared',
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const cards = computed(() => (Array.isArray(props.items) ? props.items : []))
|
|
24
|
-
|
|
25
|
-
function onSelect(item: QuickActionItem) {
|
|
26
|
-
if (item.disabled) {
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
emit('select', item)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function toneClass(tone?: 'brand' | 'neutral') {
|
|
33
|
-
if (tone === 'brand') {
|
|
34
|
-
return 'bg-[#eef2ff] text-[#3534a5]'
|
|
35
|
-
}
|
|
36
|
-
return 'bg-[#f2f4f8] text-[#5c5b7a]'
|
|
37
|
-
}
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<template>
|
|
41
|
-
<view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
42
|
-
<view class="flex items-end justify-between">
|
|
43
|
-
<view>
|
|
44
|
-
<text class="text-[28rpx] font-semibold text-[#1f1a3f]">
|
|
45
|
-
{{ title }}
|
|
46
|
-
</text>
|
|
47
|
-
<text v-if="subtitle" class="mt-[6rpx] block text-[22rpx] text-[#6f6b8a]">
|
|
48
|
-
{{ subtitle }}
|
|
49
|
-
</text>
|
|
50
|
-
</view>
|
|
51
|
-
</view>
|
|
52
|
-
<view class="mt-[16rpx] grid grid-cols-2 gap-[12rpx]">
|
|
53
|
-
<view
|
|
54
|
-
v-for="item in cards"
|
|
55
|
-
:key="item.key"
|
|
56
|
-
class="rounded-[18rpx] bg-[#f7f7fb] p-[16rpx]"
|
|
57
|
-
:class="item.disabled ? 'opacity-50' : 'opacity-100'"
|
|
58
|
-
@tap="onSelect(item)"
|
|
59
|
-
>
|
|
60
|
-
<view class="flex items-center justify-between">
|
|
61
|
-
<view class="flex items-center gap-[8rpx]">
|
|
62
|
-
<view class="flex h-[36rpx] w-[36rpx] items-center justify-center rounded-[12rpx]" :class="toneClass(item.tone)">
|
|
63
|
-
<t-icon :name="item.icon ?? 'app'" size="22" />
|
|
64
|
-
</view>
|
|
65
|
-
<text class="text-[24rpx] font-semibold text-[#1f1a3f]">
|
|
66
|
-
{{ item.title }}
|
|
67
|
-
</text>
|
|
68
|
-
</view>
|
|
69
|
-
<t-tag v-if="item.tag" size="small" theme="primary" variant="light">
|
|
70
|
-
{{ item.tag }}
|
|
71
|
-
</t-tag>
|
|
72
|
-
</view>
|
|
73
|
-
<text v-if="item.description" class="mt-[10rpx] block text-[20rpx] text-[#6f6b8a]">
|
|
74
|
-
{{ item.description }}
|
|
75
|
-
</text>
|
|
76
|
-
</view>
|
|
77
|
-
</view>
|
|
78
|
-
</view>
|
|
79
|
-
</template>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'wevu'
|
|
3
|
-
|
|
4
|
-
defineOptions({
|
|
5
|
-
options: {
|
|
6
|
-
multipleSlots: true,
|
|
7
|
-
},
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
const props = withDefaults(
|
|
11
|
-
defineProps<{
|
|
12
|
-
title: string
|
|
13
|
-
items?: ResultItem[]
|
|
14
|
-
}>(),
|
|
15
|
-
{
|
|
16
|
-
items: () => [],
|
|
17
|
-
},
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
defineComponentJson({
|
|
21
|
-
styleIsolation: 'apply-shared',
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
interface ResultItem {
|
|
25
|
-
label: string
|
|
26
|
-
value: string | number
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const rows = computed(() => props.items ?? [])
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<template>
|
|
33
|
-
<view class="rounded-[20rpx] bg-white p-[20rpx] shadow-[0_12rpx_28rpx_rgba(17,24,39,0.08)]">
|
|
34
|
-
<view class="flex items-center justify-between">
|
|
35
|
-
<text class="text-[26rpx] font-semibold text-[#1f1a3f]">
|
|
36
|
-
{{ title }}
|
|
37
|
-
</text>
|
|
38
|
-
<slot name="action" />
|
|
39
|
-
</view>
|
|
40
|
-
<view class="mt-[12rpx] space-y-[10rpx]">
|
|
41
|
-
<view v-for="row in rows" :key="row.label" class="flex items-center justify-between">
|
|
42
|
-
<text class="text-[22rpx] text-[#6f6b8a]">
|
|
43
|
-
{{ row.label }}
|
|
44
|
-
</text>
|
|
45
|
-
<text class="text-[22rpx] font-semibold text-[#1f1a3f]">
|
|
46
|
-
{{ row.value }}
|
|
47
|
-
</text>
|
|
48
|
-
</view>
|
|
49
|
-
</view>
|
|
50
|
-
</view>
|
|
51
|
-
</template>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineOptions({
|
|
3
|
-
options: {
|
|
4
|
-
multipleSlots: true,
|
|
5
|
-
},
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
withDefaults(
|
|
9
|
-
defineProps<{
|
|
10
|
-
title: string
|
|
11
|
-
subtitle?: string
|
|
12
|
-
}>(),
|
|
13
|
-
{
|
|
14
|
-
subtitle: '',
|
|
15
|
-
},
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
defineComponentJson({
|
|
19
|
-
styleIsolation: 'apply-shared',
|
|
20
|
-
})
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<template>
|
|
24
|
-
<view class="flex items-end justify-between">
|
|
25
|
-
<view>
|
|
26
|
-
<text class="text-[30rpx] font-semibold text-[#1f1a3f]">
|
|
27
|
-
{{ title }}
|
|
28
|
-
</text>
|
|
29
|
-
<text v-if="subtitle" class="mt-[6rpx] block text-[22rpx] text-[#6f6b8a]">
|
|
30
|
-
{{ subtitle }}
|
|
31
|
-
</text>
|
|
32
|
-
</view>
|
|
33
|
-
</view>
|
|
34
|
-
</template>
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'wevu'
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(
|
|
5
|
-
defineProps<{
|
|
6
|
-
title: string
|
|
7
|
-
value: number
|
|
8
|
-
unit?: string
|
|
9
|
-
delta?: number
|
|
10
|
-
progress?: number
|
|
11
|
-
}>(),
|
|
12
|
-
{
|
|
13
|
-
unit: '',
|
|
14
|
-
delta: undefined,
|
|
15
|
-
progress: undefined,
|
|
16
|
-
},
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
defineComponentJson({
|
|
20
|
-
styleIsolation: 'apply-shared',
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
type TrendTone = 'positive' | 'negative' | 'neutral'
|
|
24
|
-
|
|
25
|
-
const tone = computed<TrendTone>(() => {
|
|
26
|
-
if (props.delta === undefined || Number.isNaN(props.delta)) {
|
|
27
|
-
return 'neutral'
|
|
28
|
-
}
|
|
29
|
-
if (props.delta > 0) {
|
|
30
|
-
return 'positive'
|
|
31
|
-
}
|
|
32
|
-
if (props.delta < 0) {
|
|
33
|
-
return 'negative'
|
|
34
|
-
}
|
|
35
|
-
return 'neutral'
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const hasProgress = computed(() => {
|
|
39
|
-
if (props.progress === undefined || props.progress === null) {
|
|
40
|
-
return false
|
|
41
|
-
}
|
|
42
|
-
return Number.isFinite(Number(props.progress))
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const progressValue = computed(() => {
|
|
46
|
-
if (!hasProgress.value) {
|
|
47
|
-
return 0
|
|
48
|
-
}
|
|
49
|
-
const raw = Number(props.progress)
|
|
50
|
-
return Math.min(Math.max(raw, 0), 100)
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
function toneText(toneValue: TrendTone) {
|
|
54
|
-
if (toneValue === 'positive') {
|
|
55
|
-
return '↑'
|
|
56
|
-
}
|
|
57
|
-
if (toneValue === 'negative') {
|
|
58
|
-
return '↓'
|
|
59
|
-
}
|
|
60
|
-
return '→'
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function toneClass(toneValue: TrendTone) {
|
|
64
|
-
if (toneValue === 'positive') {
|
|
65
|
-
return 'text-[#1b7a3a]'
|
|
66
|
-
}
|
|
67
|
-
if (toneValue === 'negative') {
|
|
68
|
-
return 'text-[#b42318]'
|
|
69
|
-
}
|
|
70
|
-
return 'text-[#64748b]'
|
|
71
|
-
}
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<template>
|
|
75
|
-
<view class="rounded-[20rpx] bg-white p-[18rpx] shadow-[0_12rpx_28rpx_rgba(17,24,39,0.08)]">
|
|
76
|
-
<view class="flex items-center justify-between">
|
|
77
|
-
<text class="text-[24rpx] text-[#5b5876]">
|
|
78
|
-
{{ title }}
|
|
79
|
-
</text>
|
|
80
|
-
<text class="text-[20rpx]" :class="toneClass(tone)">
|
|
81
|
-
{{ toneText(tone) }}
|
|
82
|
-
{{ delta === undefined ? '--' : delta }}
|
|
83
|
-
</text>
|
|
84
|
-
</view>
|
|
85
|
-
<view class="mt-[12rpx] flex items-baseline gap-[6rpx]">
|
|
86
|
-
<text class="text-[36rpx] font-bold text-[#1f1a3f]">
|
|
87
|
-
{{ value }}
|
|
88
|
-
</text>
|
|
89
|
-
<text v-if="unit" class="text-[20rpx] text-[#7a7aa0]">
|
|
90
|
-
{{ unit }}
|
|
91
|
-
</text>
|
|
92
|
-
</view>
|
|
93
|
-
<t-progress
|
|
94
|
-
v-if="hasProgress"
|
|
95
|
-
class="mt-[12rpx]"
|
|
96
|
-
:percentage="progressValue"
|
|
97
|
-
status="active"
|
|
98
|
-
stroke-width="6"
|
|
99
|
-
/>
|
|
100
|
-
</view>
|
|
101
|
-
</template>
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineProps<{
|
|
3
|
-
title: string
|
|
4
|
-
subtitle: string
|
|
5
|
-
}>()
|
|
6
|
-
|
|
7
|
-
defineComponentJson({
|
|
8
|
-
styleIsolation: 'apply-shared',
|
|
9
|
-
})
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<view class="demo-card">
|
|
14
|
-
<text class="demo-title">
|
|
15
|
-
{{ title }}
|
|
16
|
-
</text>
|
|
17
|
-
<text class="demo-subtitle">
|
|
18
|
-
{{ subtitle }}
|
|
19
|
-
</text>
|
|
20
|
-
</view>
|
|
21
|
-
</template>
|
|
22
|
-
|
|
23
|
-
<style>
|
|
24
|
-
.demo-card {
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: 10rpx;
|
|
28
|
-
padding: 20rpx;
|
|
29
|
-
background: #fff;
|
|
30
|
-
border-radius: 20rpx;
|
|
31
|
-
box-shadow: 0 12rpx 28rpx rgb(17 24 39 / 8%);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.demo-title {
|
|
35
|
-
display: block;
|
|
36
|
-
font-size: 28rpx;
|
|
37
|
-
font-weight: 600;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.demo-subtitle {
|
|
41
|
-
display: block;
|
|
42
|
-
font-size: 22rpx;
|
|
43
|
-
line-height: 1.6;
|
|
44
|
-
opacity: 0.82;
|
|
45
|
-
}
|
|
46
|
-
</style>
|
package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/FixedExternalClassCard.vue
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineOptions({
|
|
3
|
-
externalClasses: ['class'],
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
defineProps<{
|
|
7
|
-
title: string
|
|
8
|
-
subtitle: string
|
|
9
|
-
}>()
|
|
10
|
-
|
|
11
|
-
defineComponentJson({
|
|
12
|
-
styleIsolation: 'apply-shared',
|
|
13
|
-
})
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<template>
|
|
17
|
-
<view class="demo-card class">
|
|
18
|
-
<text class="demo-title">
|
|
19
|
-
{{ title }}
|
|
20
|
-
</text>
|
|
21
|
-
<text class="demo-subtitle">
|
|
22
|
-
{{ subtitle }}
|
|
23
|
-
</text>
|
|
24
|
-
</view>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<style>
|
|
28
|
-
.demo-card {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
gap: 10rpx;
|
|
32
|
-
padding: 20rpx;
|
|
33
|
-
background: #fff;
|
|
34
|
-
border-radius: 20rpx;
|
|
35
|
-
box-shadow: 0 12rpx 28rpx rgb(17 24 39 / 8%);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.demo-title {
|
|
39
|
-
display: block;
|
|
40
|
-
font-size: 28rpx;
|
|
41
|
-
font-weight: 600;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.demo-subtitle {
|
|
45
|
-
display: block;
|
|
46
|
-
font-size: 22rpx;
|
|
47
|
-
line-height: 1.6;
|
|
48
|
-
opacity: 0.82;
|
|
49
|
-
}
|
|
50
|
-
</style>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineOptions({
|
|
3
|
-
externalClasses: ['custom-class'],
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
const props = withDefaults(defineProps<{
|
|
7
|
-
title: string
|
|
8
|
-
subtitle: string
|
|
9
|
-
rootStyle?: string
|
|
10
|
-
}>(), {
|
|
11
|
-
rootStyle: '',
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
defineComponentJson({
|
|
15
|
-
styleIsolation: 'apply-shared',
|
|
16
|
-
})
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<view class="demo-card custom-class" :style="props.rootStyle">
|
|
21
|
-
<text class="demo-title">
|
|
22
|
-
{{ title }}
|
|
23
|
-
</text>
|
|
24
|
-
<text class="demo-subtitle">
|
|
25
|
-
{{ subtitle }}
|
|
26
|
-
</text>
|
|
27
|
-
</view>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<style>
|
|
31
|
-
.demo-card {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
gap: 10rpx;
|
|
35
|
-
padding: 20rpx;
|
|
36
|
-
background: #fff;
|
|
37
|
-
border-radius: 20rpx;
|
|
38
|
-
box-shadow: 0 12rpx 28rpx rgb(17 24 39 / 8%);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.demo-title {
|
|
42
|
-
display: block;
|
|
43
|
-
font-size: 28rpx;
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.demo-subtitle {
|
|
48
|
-
display: block;
|
|
49
|
-
font-size: 22rpx;
|
|
50
|
-
line-height: 1.6;
|
|
51
|
-
opacity: 0.82;
|
|
52
|
-
}
|
|
53
|
-
</style>
|