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.
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-D8uqfCKh.js → src-C8kzMXK7.js} +1 -1
- package/package.json +1 -1
- package/templates/wevu/README.md +3 -3
- package/templates/wevu/package.json +1 -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/README.md +3 -6
- package/templates/wevu-tdesign/package.json +1 -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
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, t as createProject } from "./src-
|
|
1
|
+
import { n as RECOMMENDED_SKILLS_INSTALL_COMMAND, t as createProject } from "./src-C8kzMXK7.js";
|
|
2
2
|
import logger from "@weapp-core/logger";
|
|
3
3
|
import { fs } from "@weapp-core/shared/fs";
|
|
4
4
|
import process from "node:process";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as TemplateName, t as createProject } from "./src-
|
|
1
|
+
import { r as TemplateName, t as createProject } from "./src-C8kzMXK7.js";
|
|
2
2
|
export { TemplateName, createProject };
|
package/package.json
CHANGED
package/templates/wevu/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# weapp-vite-wevu-template
|
|
2
2
|
|
|
3
|
-
`weapp-vite` + `wevu`(Vue SFC
|
|
3
|
+
`weapp-vite` + `wevu`(Vue SFC)最小模板。
|
|
4
4
|
|
|
5
5
|
## 使用方式
|
|
6
6
|
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
- 页面/组件优先使用 Vue `<script setup>`(编译宏)写法
|
|
16
16
|
- 配置使用 `<json>` 自定义块
|
|
17
|
-
- `
|
|
18
|
-
-
|
|
17
|
+
- `app.json` 里的 `pages` 通过 `weapp-vite/auto-routes` 自动生成
|
|
18
|
+
- layout、分包、router 等验证性示例在 `e2e-apps/template-wevu-regression`
|
|
19
19
|
|
|
20
20
|
### 构建
|
|
21
21
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import autoRoutes from 'weapp-vite/auto-routes'
|
|
3
|
-
import { onHide, onLaunch, onShow } from 'wevu'
|
|
4
|
-
import { wpi } from 'wevu/api'
|
|
5
|
-
import { createRouter } from 'wevu/router'
|
|
6
3
|
|
|
7
4
|
defineAppJson({
|
|
8
5
|
pages: autoRoutes.pages,
|
|
9
|
-
subPackages: autoRoutes.subPackages,
|
|
10
6
|
window: {
|
|
11
|
-
navigationBarTitleText: '
|
|
7
|
+
navigationBarTitleText: 'Wevu 模板',
|
|
12
8
|
navigationBarBackgroundColor: '#0f172a',
|
|
13
9
|
navigationBarTextStyle: 'white',
|
|
14
10
|
},
|
|
@@ -16,61 +12,6 @@ defineAppJson({
|
|
|
16
12
|
componentFramework: 'glass-easel',
|
|
17
13
|
sitemapLocation: 'sitemap.json',
|
|
18
14
|
})
|
|
19
|
-
|
|
20
|
-
const logger = wpi.getLogManager({ level: 1 })
|
|
21
|
-
|
|
22
|
-
const router = createRouter({
|
|
23
|
-
routes: autoRoutes.entries.map(path => ({
|
|
24
|
-
name: path,
|
|
25
|
-
path: `/${path}`,
|
|
26
|
-
})),
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
router.beforeEach((to, from) => {
|
|
30
|
-
logger.info('[wevu-template-router] beforeEach', {
|
|
31
|
-
to: to?.fullPath,
|
|
32
|
-
from: from.fullPath,
|
|
33
|
-
})
|
|
34
|
-
return true
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
router.beforeResolve((to, from) => {
|
|
38
|
-
logger.info('[wevu-template-router] beforeResolve', {
|
|
39
|
-
to: to?.fullPath,
|
|
40
|
-
from: from.fullPath,
|
|
41
|
-
})
|
|
42
|
-
return true
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
router.afterEach((to, from, failure) => {
|
|
46
|
-
logger.info('[wevu-template-router] afterEach', {
|
|
47
|
-
to: to?.fullPath,
|
|
48
|
-
from: from.fullPath,
|
|
49
|
-
failureType: failure?.type,
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
router.onError((error, context) => {
|
|
54
|
-
logger.info('[wevu-template-router] onError', {
|
|
55
|
-
error: error instanceof Error ? error.message : String(error),
|
|
56
|
-
mode: context.mode,
|
|
57
|
-
to: context.to?.fullPath,
|
|
58
|
-
from: context.from.fullPath,
|
|
59
|
-
failureType: context.failure.type,
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
onShow(() => {
|
|
64
|
-
logger.info('[weapp-vite-wevu-template] app show')
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
onHide(() => {
|
|
68
|
-
logger.info('[weapp-vite-wevu-template] app hide')
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
onLaunch(() => {
|
|
72
|
-
logger.info('[weapp-vite-wevu-template] app launch')
|
|
73
|
-
})
|
|
74
15
|
</script>
|
|
75
16
|
|
|
76
17
|
<style>
|
|
@@ -1,136 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'wevu'
|
|
3
|
-
import { useRoute, useRouter } from 'wevu/router'
|
|
2
|
+
import { computed, ref } from 'wevu'
|
|
4
3
|
|
|
5
4
|
definePageJson({
|
|
6
|
-
navigationBarTitleText: '
|
|
5
|
+
navigationBarTitleText: 'Wevu 模板',
|
|
7
6
|
})
|
|
8
7
|
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const WORKSPACE_PATH = '/packageA/pages/workspace/index'
|
|
12
|
-
const SETTINGS_PATH = '/packageB/pages/settings/index'
|
|
13
|
-
const LAYOUTS_PATH = '/pages/layouts/index'
|
|
14
|
-
|
|
15
|
-
const route = useRoute()
|
|
16
|
-
const router = useRouter()
|
|
17
|
-
const routeSummary = computed(() => route.fullPath || `/${route.path}`)
|
|
18
|
-
|
|
19
|
-
const metrics = [
|
|
20
|
-
{ label: '本周跟进事项', value: '12', detail: '含 3 项需今日确认' },
|
|
21
|
-
{ label: '交付进度', value: '86%', detail: '版本提测准备完成' },
|
|
22
|
-
{ label: '服务可用率', value: '99.95%', detail: '核心链路运行稳定' },
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
const quickLinks = [
|
|
26
|
-
{
|
|
27
|
-
title: '运营概览',
|
|
28
|
-
description: '查看阶段目标、团队协同与项目节奏。',
|
|
29
|
-
action: '进入概览',
|
|
30
|
-
path: OVERVIEW_PATH,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
title: '项目工作台',
|
|
34
|
-
description: '集中处理待办任务、优先级与排期。',
|
|
35
|
-
action: '打开工作台',
|
|
36
|
-
path: WORKSPACE_PATH,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
title: '系统设置',
|
|
40
|
-
description: '统一管理通知、权限与环境配置。',
|
|
41
|
-
action: '前往设置',
|
|
42
|
-
path: SETTINGS_PATH,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
title: '页面布局',
|
|
46
|
-
description: '体验 default/admin/false 三种页面壳切换方式。',
|
|
47
|
-
action: '打开布局页',
|
|
48
|
-
path: LAYOUTS_PATH,
|
|
49
|
-
},
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
async function pushTo(path: string) {
|
|
53
|
-
await router.push(path)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function relaunchToHome() {
|
|
57
|
-
await router.nativeRouter.reLaunch({
|
|
58
|
-
url: HOME_PATH,
|
|
59
|
-
})
|
|
60
|
-
}
|
|
8
|
+
const count = ref(0)
|
|
9
|
+
const doubled = computed(() => count.value * 2)
|
|
61
10
|
</script>
|
|
62
11
|
|
|
63
12
|
<template>
|
|
64
13
|
<view class="page">
|
|
65
|
-
<view class="
|
|
66
|
-
<view class="hero__eyebrow">
|
|
67
|
-
企业业务模板
|
|
68
|
-
</view>
|
|
14
|
+
<view class="card">
|
|
69
15
|
<view class="hero__title">
|
|
70
|
-
|
|
16
|
+
Weapp-vite + Wevu
|
|
71
17
|
</view>
|
|
72
18
|
<view class="hero__desc">
|
|
73
|
-
|
|
74
|
-
</view>
|
|
75
|
-
<view class="hero__pills">
|
|
76
|
-
<StatusPill label="主包首页" tone="accent" />
|
|
77
|
-
<StatusPill label="可扩展分包" tone="neutral" />
|
|
78
|
-
<StatusPill label="适合二次开发" tone="success" />
|
|
79
|
-
</view>
|
|
80
|
-
</view>
|
|
81
|
-
|
|
82
|
-
<view class="section">
|
|
83
|
-
<view class="section__title">
|
|
84
|
-
核心指标
|
|
85
|
-
</view>
|
|
86
|
-
<view
|
|
87
|
-
v-for="item in metrics"
|
|
88
|
-
:key="item.label"
|
|
89
|
-
class="metric-card"
|
|
90
|
-
>
|
|
91
|
-
<view class="metric-card__label">
|
|
92
|
-
{{ item.label }}
|
|
93
|
-
</view>
|
|
94
|
-
<view class="metric-card__value">
|
|
95
|
-
{{ item.value }}
|
|
96
|
-
</view>
|
|
97
|
-
<view class="metric-card__detail">
|
|
98
|
-
{{ item.detail }}
|
|
99
|
-
</view>
|
|
19
|
+
一个尽量小的 Vue SFC 小程序起点,复杂能力示例请看 e2e-apps。
|
|
100
20
|
</view>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<view class="section__title">
|
|
105
|
-
常用入口
|
|
21
|
+
<view class="counter">
|
|
22
|
+
<text>count: {{ count }}</text>
|
|
23
|
+
<text>double: {{ doubled }}</text>
|
|
106
24
|
</view>
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
:key="link.path"
|
|
110
|
-
class="entry-card"
|
|
111
|
-
>
|
|
112
|
-
<InfoPanel
|
|
113
|
-
eyebrow="PAGE"
|
|
114
|
-
:title="link.title"
|
|
115
|
-
:description="link.description"
|
|
116
|
-
/>
|
|
117
|
-
<button class="action-btn" @tap="pushTo(link.path)">
|
|
118
|
-
{{ link.action }}
|
|
119
|
-
</button>
|
|
120
|
-
</view>
|
|
121
|
-
</view>
|
|
122
|
-
|
|
123
|
-
<view class="section">
|
|
124
|
-
<InfoPanel
|
|
125
|
-
eyebrow="ROUTER"
|
|
126
|
-
title="导航状态"
|
|
127
|
-
description="模板保留路由能力作为底层基础,但将其放在辅助信息层,避免首页呈现为技术功能演示页。"
|
|
128
|
-
/>
|
|
129
|
-
<view class="route-note">
|
|
130
|
-
当前路由:{{ routeSummary }}
|
|
131
|
-
</view>
|
|
132
|
-
<button class="action-btn action-btn--light" @tap="relaunchToHome">
|
|
133
|
-
reLaunch 当前首页
|
|
25
|
+
<button class="action-btn" @tap="count += 1">
|
|
26
|
+
+1
|
|
134
27
|
</button>
|
|
135
28
|
</view>
|
|
136
29
|
</view>
|
|
@@ -140,103 +33,42 @@ async function relaunchToHome() {
|
|
|
140
33
|
.page {
|
|
141
34
|
box-sizing: border-box;
|
|
142
35
|
min-height: 100vh;
|
|
143
|
-
padding:
|
|
144
|
-
background:
|
|
145
|
-
radial-gradient(circle at top right, rgb(59 130 246 / 12%), transparent 30%),
|
|
146
|
-
linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
|
|
36
|
+
padding: 32rpx;
|
|
37
|
+
background: #f3f6fb;
|
|
147
38
|
}
|
|
148
39
|
|
|
149
|
-
.
|
|
150
|
-
padding:
|
|
151
|
-
background:
|
|
152
|
-
border
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.hero__eyebrow {
|
|
157
|
-
font-size: 22rpx;
|
|
158
|
-
font-weight: 600;
|
|
159
|
-
color: rgb(226 232 240 / 88%);
|
|
160
|
-
letter-spacing: 2rpx;
|
|
40
|
+
.card {
|
|
41
|
+
padding: 32rpx;
|
|
42
|
+
background: #fff;
|
|
43
|
+
border: 2rpx solid #e2e8f0;
|
|
44
|
+
border-radius: 24rpx;
|
|
161
45
|
}
|
|
162
46
|
|
|
163
47
|
.hero__title {
|
|
164
|
-
|
|
165
|
-
font-size: 42rpx;
|
|
48
|
+
font-size: 36rpx;
|
|
166
49
|
font-weight: 700;
|
|
167
|
-
|
|
168
|
-
color: #fff;
|
|
50
|
+
color: #0f172a;
|
|
169
51
|
}
|
|
170
52
|
|
|
171
53
|
.hero__desc {
|
|
172
54
|
margin-top: 16rpx;
|
|
173
55
|
font-size: 24rpx;
|
|
174
56
|
line-height: 1.6;
|
|
175
|
-
color:
|
|
57
|
+
color: #475569;
|
|
176
58
|
}
|
|
177
59
|
|
|
178
|
-
.
|
|
60
|
+
.counter {
|
|
179
61
|
display: flex;
|
|
180
|
-
|
|
181
|
-
gap: 14rpx;
|
|
182
|
-
margin-top: 24rpx;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.section {
|
|
62
|
+
gap: 24rpx;
|
|
186
63
|
margin-top: 24rpx;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.section__title {
|
|
190
|
-
margin-bottom: 16rpx;
|
|
191
|
-
font-size: 28rpx;
|
|
192
|
-
font-weight: 700;
|
|
193
|
-
color: #0f172a;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.metric-card,
|
|
197
|
-
.entry-card {
|
|
198
|
-
padding: 24rpx;
|
|
199
|
-
margin-top: 16rpx;
|
|
200
|
-
background: rgb(255 255 255 / 92%);
|
|
201
|
-
border: 2rpx solid rgb(226 232 240 / 88%);
|
|
202
|
-
border-radius: 28rpx;
|
|
203
|
-
box-shadow: 0 12rpx 32rpx rgb(15 23 42 / 4%);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.metric-card__label {
|
|
207
|
-
font-size: 22rpx;
|
|
208
|
-
color: #64748b;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.metric-card__value {
|
|
212
|
-
margin-top: 12rpx;
|
|
213
|
-
font-size: 44rpx;
|
|
214
|
-
font-weight: 700;
|
|
64
|
+
font-size: 26rpx;
|
|
215
65
|
color: #0f172a;
|
|
216
66
|
}
|
|
217
67
|
|
|
218
|
-
.metric-card__detail {
|
|
219
|
-
margin-top: 8rpx;
|
|
220
|
-
font-size: 24rpx;
|
|
221
|
-
line-height: 1.6;
|
|
222
|
-
color: #475569;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.route-note {
|
|
226
|
-
margin-top: 16rpx;
|
|
227
|
-
font-size: 22rpx;
|
|
228
|
-
color: #64748b;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
68
|
.action-btn {
|
|
232
|
-
margin-top:
|
|
69
|
+
margin-top: 24rpx;
|
|
233
70
|
color: #fff;
|
|
234
71
|
background: #0f172a;
|
|
235
72
|
border-radius: 999rpx;
|
|
236
73
|
}
|
|
237
|
-
|
|
238
|
-
.action-btn--light {
|
|
239
|
-
color: #0f172a;
|
|
240
|
-
background: #e2e8f0;
|
|
241
|
-
}
|
|
242
74
|
</style>
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, setPageLayout } from 'wevu'
|
|
3
|
-
import { useRouter } from 'wevu/router'
|
|
4
3
|
|
|
5
4
|
definePageJson({
|
|
6
5
|
navigationBarTitleText: '页面布局',
|
|
7
6
|
})
|
|
8
7
|
|
|
9
|
-
const router = useRouter()
|
|
10
8
|
const currentLayout = ref<'default' | 'admin' | 'none'>('default')
|
|
11
9
|
|
|
12
10
|
const cards = [
|
|
@@ -41,14 +39,6 @@ function clearLayout() {
|
|
|
41
39
|
currentLayout.value = 'none'
|
|
42
40
|
setPageLayout(false)
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
async function backHome() {
|
|
46
|
-
await router.push('/pages/index/index')
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
definePageJson({
|
|
50
|
-
navigationBarTitleText: '页面布局',
|
|
51
|
-
})
|
|
52
42
|
</script>
|
|
53
43
|
|
|
54
44
|
<template>
|
|
@@ -88,9 +78,6 @@ definePageJson({
|
|
|
88
78
|
<button class="action-btn action-btn--ghost" @tap="clearLayout">
|
|
89
79
|
关闭布局
|
|
90
80
|
</button>
|
|
91
|
-
<button class="action-btn action-btn--light" @tap="backHome">
|
|
92
|
-
返回首页
|
|
93
|
-
</button>
|
|
94
81
|
</view>
|
|
95
82
|
</view>
|
|
96
83
|
</template>
|
|
@@ -161,9 +148,4 @@ definePageJson({
|
|
|
161
148
|
color: #0f172a;
|
|
162
149
|
background: #e2e8f0;
|
|
163
150
|
}
|
|
164
|
-
|
|
165
|
-
.action-btn--light {
|
|
166
|
-
color: #1d4ed8;
|
|
167
|
-
background: #dbeafe;
|
|
168
|
-
}
|
|
169
151
|
</style>
|
|
@@ -4,13 +4,6 @@ export default defineConfig(() => ({
|
|
|
4
4
|
weapp: {
|
|
5
5
|
srcRoot: 'src',
|
|
6
6
|
autoRoutes: true,
|
|
7
|
-
autoImportComponents: true,
|
|
8
|
-
subPackages: {
|
|
9
|
-
packageA: {},
|
|
10
|
-
packageB: {
|
|
11
|
-
independent: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
7
|
},
|
|
15
8
|
// weapp-vite 内置的 Vue 支持会自动处理 .vue 文件,不需要额外插件
|
|
16
9
|
}))
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
# weapp-vite-wevu-template
|
|
2
2
|
|
|
3
|
-
`weapp-vite` + `wevu
|
|
4
|
-
|
|
5
|
-
## 页面结构
|
|
6
|
-
|
|
7
|
-
- TabBar:`首页` / `数据` / `表单` / `清单` / `能力`
|
|
8
|
-
- 子包:`组件实验室`(subpackages/lab)与 `API 场景`(subpackages/ability)
|
|
3
|
+
`weapp-vite` + `wevu` + `TDesign` + `Tailwind CSS` 最小模板。
|
|
9
4
|
|
|
10
5
|
## 使用方式
|
|
11
6
|
|
|
@@ -19,6 +14,8 @@
|
|
|
19
14
|
|
|
20
15
|
- 页面/组件优先使用 Vue `<script setup>`(编译宏)写法
|
|
21
16
|
- 配置使用 `<json>` 自定义块
|
|
17
|
+
- TDesign 组件通过 `TDesignResolver()` 自动导入
|
|
18
|
+
- 复杂页面、layout feedback、class/style 绑定等验证性示例在 `e2e-apps/template-wevu-tdesign-regression`
|
|
22
19
|
|
|
23
20
|
### 构建
|
|
24
21
|
|
|
@@ -12,72 +12,6 @@
|
|
|
12
12
|
"pathName": "pages/index/index",
|
|
13
13
|
"query": "",
|
|
14
14
|
"scene": null
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": "布局页",
|
|
18
|
-
"pathName": "pages/layouts/index",
|
|
19
|
-
"query": "",
|
|
20
|
-
"scene": null
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "Layout 通信演示",
|
|
24
|
-
"pathName": "pages/layout-feedback/index",
|
|
25
|
-
"query": "",
|
|
26
|
-
"scene": null
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "Store 调用 Layout",
|
|
30
|
-
"pathName": "pages/layout-store/index",
|
|
31
|
-
"query": "",
|
|
32
|
-
"scene": null
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "数据页",
|
|
36
|
-
"pathName": "pages/data/index",
|
|
37
|
-
"query": "",
|
|
38
|
-
"scene": null
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"name": "表单页",
|
|
42
|
-
"pathName": "pages/form/index",
|
|
43
|
-
"query": "",
|
|
44
|
-
"scene": null
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "清单页",
|
|
48
|
-
"pathName": "pages/list/index",
|
|
49
|
-
"query": "",
|
|
50
|
-
"scene": null
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "能力页",
|
|
54
|
-
"pathName": "pages/ability/index",
|
|
55
|
-
"query": "",
|
|
56
|
-
"scene": null
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "组件实验室",
|
|
60
|
-
"pathName": "subpackages/lab/index",
|
|
61
|
-
"query": "",
|
|
62
|
-
"scene": null
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"name": "Class 绑定实验室",
|
|
66
|
-
"pathName": "subpackages/lab/class-binding/index",
|
|
67
|
-
"query": "",
|
|
68
|
-
"scene": null
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"name": "virtualHost class 透传实验",
|
|
72
|
-
"pathName": "subpackages/lab/virtual-host-class/index",
|
|
73
|
-
"query": "",
|
|
74
|
-
"scene": null
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"name": "系统能力页",
|
|
78
|
-
"pathName": "subpackages/ability/index",
|
|
79
|
-
"query": "",
|
|
80
|
-
"scene": null
|
|
81
15
|
}
|
|
82
16
|
]
|
|
83
17
|
}
|
|
@@ -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: '
|
|
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>
|