diff --git a/package.json b/package.json
index 84a1298..3d1e8aa 100644
--- a/package.json
+++ b/package.json
@@ -121,7 +121,6 @@
"pinia-plugin-persistedstate": "3.2.1",
"vue": "^3.4.21",
"vue-router": "4.5.1",
- "wot-design-uni": "^1.12.4",
"z-paging": "2.8.7"
},
"devDependencies": {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a6022c6..503c42e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -90,9 +90,6 @@ importers:
vue-router:
specifier: 4.5.1
version: 4.5.1(vue@3.4.21(typescript@5.8.3))
- wot-design-uni:
- specifier: ^1.12.4
- version: 1.12.4(vue@3.4.21(typescript@5.8.3))
z-paging:
specifier: 2.8.7
version: 2.8.7
@@ -6143,12 +6140,6 @@ packages:
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
- wot-design-uni@1.12.4:
- resolution: {integrity: sha512-GE7hfJ+RKRCiWtEkhoQ5gz3fbwNB69EzLcXiIUPK2gawk9+hp7KescjplcxdxGfeuCJUlhF6wW9VUEe86h/63g==}
- engines: {HBuilderX: ^3.8.7}
- peerDependencies:
- vue: '>=3.2.47'
-
wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
@@ -13874,10 +13865,6 @@ snapshots:
word-wrap@1.2.5: {}
- wot-design-uni@1.12.4(vue@3.4.21(typescript@5.8.3)):
- dependencies:
- vue: 3.4.21(typescript@5.8.3)
-
wrap-ansi@7.0.0:
dependencies:
ansi-styles: 4.3.0
diff --git a/src/App.ku.vue b/src/App.ku.vue
index 8aab489..8d4ee68 100644
--- a/src/App.ku.vue
+++ b/src/App.ku.vue
@@ -1,12 +1,9 @@
-
-
-
- {{ helloKuRoot }},这里可以配置全局的东西
-
+
+
+ {{ helloKuRoot }},这里可以配置全局的东西
+
-
+
-
-
-
-
+
diff --git a/src/App.vue b/src/App.vue
index 9c47bc2..e2179ee 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,10 +3,10 @@ import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
import { navigateToInterceptor } from '@/router/interceptor'
onLaunch((options) => {
- console.log('App Launch', options)
+ console.log('App.vue onLaunch', options)
})
onShow((options) => {
- console.log('App Show', options)
+ console.log('App.vue onShow', options)
// 处理直接进入页面路由的情况:如h5直接输入路由、微信小程序分享后进入等
// https://github.com/unibest-tech/unibest/issues/192
if (options?.path) {
diff --git a/src/layouts/default.vue b/src/layouts/default.vue
index 88a55d4..ba4672f 100644
--- a/src/layouts/default.vue
+++ b/src/layouts/default.vue
@@ -1,10 +1,3 @@
-
-
diff --git a/src/pages-fg/404/README.md b/src/pages-fg/404/README.md
deleted file mode 100644
index ecc8aa4..0000000
--- a/src/pages-fg/404/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# 404 页面
-
-`404页面` 只有在路由不存在时才会显示,如果您不需要可以删除该页面。但是建议保留。
\ No newline at end of file
diff --git a/src/pages-fg/404/index.vue b/src/pages-fg/404/index.vue
deleted file mode 100644
index 533e259..0000000
--- a/src/pages-fg/404/index.vue
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- 404
- 页面不存在
-
-
-
-
-
diff --git a/src/pages-fg/REAME.md b/src/pages-fg/REAME.md
deleted file mode 100644
index 55479de..0000000
--- a/src/pages-fg/REAME.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# pages-fg 说明
-
-为了尽量减少主包的大小,一些无关紧要但经常需要的页面(如登录页、注册页、404页等)放在了 `pages-fg` 目录下。
diff --git a/src/pages-fg/login/README.md b/src/pages-fg/login/README.md
deleted file mode 100644
index c851a76..0000000
--- a/src/pages-fg/login/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# 登录页
-需要输入账号、密码/验证码的登录页。
-
-## 适用性
-
-本页面主要用于 `h5` 和 `APP`。
-
-小程序通常有平台的登录方式 `uni.login` 通常用不到登录页,所以不适用于 `小程序`。(即默认情况下,小程序环境是不会走登录拦截逻辑的。)
-
-但是如果您的小程序也需要现实的 `登录页` 那也是可以使用的。
-
-在 `src/router/config.ts` 中有一个变量 `LOGIN_PAGE_ENABLE_IN_MP` 来控制是否在小程序中使用 `H5的登录页`。
-
-更多信息请看 `src/router` 文件夹的内容。
-
-## 登录跳转
-
-目前登录的跳转逻辑主要在 `src/router/interceptor.ts` 和 `src/pages/login/login.vue` 里面,默认会在登录后自动重定向到来源/配置的页面。
-
-如果与您的业务不符,您可以自行修改。
diff --git a/src/pages-fg/login/login.vue b/src/pages-fg/login/login.vue
deleted file mode 100644
index 0fa5e95..0000000
--- a/src/pages-fg/login/login.vue
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
- 登录页
-
-
-
-
-
-
diff --git a/src/pages-fg/login/register.vue b/src/pages-fg/login/register.vue
deleted file mode 100644
index e9809f0..0000000
--- a/src/pages-fg/login/register.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
- 注册页
-
-
-
-
-
-
diff --git a/src/pages-sub/about/about.vue b/src/pages-sub/about/about.vue
deleted file mode 100644
index b4bf1e6..0000000
--- a/src/pages-sub/about/about.vue
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
-
-
- 请求调用、unocss、static图片
-
-
-
-
-
- 当前是否登录:{{ tokenStore.hasLogin }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 为了方便脚手架动态生成不同UI模板,本页的按钮统一使用UI库无关的原生button
-
-
-
-
-
diff --git a/src/pages-sub/about/alova.vue b/src/pages-sub/about/alova.vue
deleted file mode 100644
index 4b0c43f..0000000
--- a/src/pages-sub/about/alova.vue
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
-
-
-
- loading...
-
-
-
- 请求数据如下
-
-
- {{ JSON.stringify(data) }}
-
-
-
-
- {{ data?.id }}
-
-
-
-
-
-
-
diff --git a/src/pages-sub/about/components/Upload.vue b/src/pages-sub/about/components/Upload.vue
deleted file mode 100644
index 09547f5..0000000
--- a/src/pages-sub/about/components/Upload.vue
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
- 上传...
-
-
-
- 上传后返回的接口数据:
-
-
- {{ data }}
-
-
-
-
-
-
-
-
-
diff --git a/src/pages-sub/about/components/VBindCss.vue b/src/pages-sub/about/components/VBindCss.vue
deleted file mode 100644
index bc5a048..0000000
--- a/src/pages-sub/about/components/VBindCss.vue
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
- 测试v-bind css变量的具体文案
-
-
-
-
diff --git a/src/pages-sub/about/components/request-openapi.vue b/src/pages-sub/about/components/request-openapi.vue
deleted file mode 100644
index 53f78ad..0000000
--- a/src/pages-sub/about/components/request-openapi.vue
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
- 1)直接使用 openapi 生成的请求
-
-
-
-
- 请求数据如下
-
-
- {{ JSON.stringify(userInfo) }}
-
-
-
- 2)直接使用 openapi + useRequest 生成的请求
-
-
-
-
-
- 请求数据如下
-
-
- {{ JSON.stringify(userList) }}
-
-
-
diff --git a/src/pages-sub/about/components/request.vue b/src/pages-sub/about/components/request.vue
deleted file mode 100644
index 73db16b..0000000
--- a/src/pages-sub/about/components/request.vue
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
- pages 里面的 vue 文件会扫描成页面,将自动添加到 pages.json 里面。
-
-
- 但是 components 里面的 vue 不会。
-
-
-
-
-
-
-
- loading...
-
-
-
- 错误: {{ error.message }}
-
-
- 错误: 未知错误
-
-
-
- 请求数据如下
-
-
- {{ JSON.stringify(data) }}
-
-
-
-
-
-
-
-
-
diff --git a/src/pages-sub/demo/components/request.vue b/src/pages-sub/demo/components/request.vue
deleted file mode 100644
index 7d7bff1..0000000
--- a/src/pages-sub/demo/components/request.vue
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
- loading...
-
-
-
- 请求数据如下
-
-
- {{ JSON.stringify(data) }}
-
-
-
-
-
-
-
-
diff --git a/src/pages-sub/demo/index.vue b/src/pages-sub/demo/index.vue
deleted file mode 100644
index 3831b5f..0000000
--- a/src/pages-sub/demo/index.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
- http://localhost:9000/#/pages-sub/demo/index
-
-
- 分包页面demo
-
-
- 分包页面里面的components示例
-
-
-
-
-
- 本地SVG图标示例
-
-
-
-
-
-
-
diff --git a/src/pages-sub/demo/scroll.vue b/src/pages-sub/demo/scroll.vue
deleted file mode 100644
index 2599163..0000000
--- a/src/pages-sub/demo/scroll.vue
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
-
- 加载失败,请重试
-
-
-
- {{ item.name }}
-
-
- 加载中...
-
-
- 没有更多了
-
-
-
-
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 687d096..27b81b8 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -1,7 +1,4 @@
-
+
@@ -62,53 +49,5 @@ function gotoAbout() {
https://unibest.tech
-
-
-
-
- 新手请看必看章节1:
-
-
-
-
-
- 新手请看必看章节1:
-
- https://unibest.tech/base/3-plugin
-
-
-
-
-
-
- 新手请看必看章节2:
-
-
-
-
-
- 新手请看必看章节2:
-
- https://unibest.tech/base/14-faq
-
-
-
-
-
-
- 设置主题变量
-
-
-
- UI组件官网:
- https://wot-design-uni.cn
-
-
-
-
- 前往示例页
-
-
-
diff --git a/src/pages/me/me.vue b/src/pages/me/me.vue
index c43a47c..5df9e2e 100644
--- a/src/pages/me/me.vue
+++ b/src/pages/me/me.vue
@@ -1,214 +1,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ userInfo.username }}
-
-
-
- ID: {{ userInfo.userId }}
-
-
-
-
-
- {{ JSON.stringify(userInfo, null, 2) }}
-
-
-
-
-
-
-
-
+
+ 我的页面
-
-
diff --git a/src/router/config.ts b/src/router/config.ts
deleted file mode 100644
index 2d0e52d..0000000
--- a/src/router/config.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { getAllPages } from '@/utils'
-
-export const LOGIN_STRATEGY_MAP = {
- DEFAULT_NO_NEED_LOGIN: 0, // 黑名单策略,默认可以进入APP
- DEFAULT_NEED_LOGIN: 1, // 白名单策略,默认不可以进入APP,需要强制登录
-}
-// TODO: 1/3 登录策略,默认使用`无需登录策略`,即默认不需要登录就可以访问
-export const LOGIN_STRATEGY = LOGIN_STRATEGY_MAP.DEFAULT_NO_NEED_LOGIN
-export const isNeedLoginMode = LOGIN_STRATEGY === LOGIN_STRATEGY_MAP.DEFAULT_NEED_LOGIN
-
-export const LOGIN_PAGE = '/pages-fg/login/login'
-export const REGISTER_PAGE = '/pages-fg/login/register'
-export const NOT_FOUND_PAGE = '/pages-fg/404/index'
-
-export const LOGIN_PAGE_LIST = [LOGIN_PAGE, REGISTER_PAGE]
-
-// 在 definePage 里面配置了 excludeLoginPath 的页面,功能与 EXCLUDE_LOGIN_PATH_LIST 相同
-export const excludeLoginPathList = getAllPages('excludeLoginPath').map(page => page.path)
-
-// 排除在外的列表,白名单策略指白名单列表,黑名单策略指黑名单列表
-// TODO: 2/3 在 definePage 配置 excludeLoginPath,或者在下面配置 EXCLUDE_LOGIN_PATH_LIST
-export const EXCLUDE_LOGIN_PATH_LIST = [
- '/pages/xxx/index', // 示例值
- '/pages-sub/xxx/index', // 示例值
- ...excludeLoginPathList, // 都是以 / 开头的 path
-]
-
-// 在小程序里面是否使用H5的登录页,默认为 false
-// 如果为 true 则复用 h5 的登录逻辑
-// TODO: 3/3 确定自己的登录页是否需要在小程序里面使用
-export const LOGIN_PAGE_ENABLE_IN_MP = false
diff --git a/src/router/interceptor.ts b/src/router/interceptor.ts
index 2b7b1ab..e5b6046 100644
--- a/src/router/interceptor.ts
+++ b/src/router/interceptor.ts
@@ -1,24 +1,12 @@
-import { isMp } from '@uni-helper/uni-env'
/**
* by 菲鸽 on 2025-08-19
* 路由拦截,通常也是登录拦截
* 黑、白名单的配置,请看 config.ts 文件, EXCLUDE_LOGIN_PATH_LIST
*/
-import { useTokenStore } from '@/store/token'
-import { isPageTabbar, tabbarStore } from '@/tabbar/store'
-import { getAllPages, getLastPage, HOME_PAGE, parseUrlToObj } from '@/utils/index'
-import { toLoginPage } from '@/utils/toLoginPage'
-import { EXCLUDE_LOGIN_PATH_LIST, isNeedLoginMode, LOGIN_PAGE, LOGIN_PAGE_ENABLE_IN_MP, NOT_FOUND_PAGE } from './config'
+import { tabbarStore } from '@/tabbar/store'
+import { getAllPages, getLastPage, parseUrlToObj } from '@/utils/index'
export const FG_LOG_ENABLE = false
-export function judgeIsExcludePath(path: string) {
- const isDev = import.meta.env.DEV
- if (!isDev) {
- return EXCLUDE_LOGIN_PATH_LIST.includes(path)
- }
- const allExcludeLoginPages = getAllPages('excludeLoginPath') // dev 环境下,需要每次都重新获取,否则新配置就不会生效
- return EXCLUDE_LOGIN_PATH_LIST.includes(path) || (isDev && allExcludeLoginPages.some(page => page.path === path))
-}
export const navigateToInterceptor = {
// 注意,这里的url是 '/' 开头的,如 '/pages/index/index',跟 'pages.json' 里面的 path 不同
@@ -47,74 +35,11 @@ export const navigateToInterceptor = {
// 处理路由不存在的情况
if (path !== '/' && !getAllPages().some(page => page.path !== path)) {
console.warn('路由不存在:', path)
- uni.navigateTo({ url: NOT_FOUND_PAGE })
return false // 明确表示阻止原路由继续执行
}
// 处理直接进入路由非首页时,tabbarIndex 不正确的问题
tabbarStore.setAutoCurIdx(path)
-
- // 小程序里面使用平台自带的登录,则不走下面的逻辑
- if (isMp && !LOGIN_PAGE_ENABLE_IN_MP) {
- return true // 明确表示允许路由继续执行
- }
-
- const tokenStore = useTokenStore()
- FG_LOG_ENABLE && console.log('tokenStore.hasLogin:', tokenStore.hasLogin)
-
- // 不管黑白名单,登录了就直接去吧(但是当前不能是登录页)
- if (tokenStore.hasLogin) {
- if (path !== LOGIN_PAGE) {
- return true // 明确表示允许路由继续执行
- }
- else {
- console.log('已经登录,但是还在登录页', myQuery.redirect)
- const url = myQuery.redirect || HOME_PAGE
- if (isPageTabbar(url)) {
- uni.switchTab({ url })
- }
- else {
- uni.navigateTo({ url })
- }
- return false // 明确表示阻止原路由继续执行
- }
- }
- let fullPath = path
-
- if (Object.keys(myQuery).length) {
- fullPath += `?${Object.keys(myQuery).map(key => `${key}=${myQuery[key]}`).join('&')}`
- }
- const redirectQuery = `?redirect=${encodeURIComponent(fullPath)}`
-
- // #region 1/2 默认需要登录的情况(白名单策略) ---------------------------
- if (isNeedLoginMode) {
- // 需要登录里面的 EXCLUDE_LOGIN_PATH_LIST 表示白名单,可以直接通过
- if (judgeIsExcludePath(path)) {
- return true // 明确表示允许路由继续执行
- }
- // 否则需要重定向到登录页
- else {
- if (path === LOGIN_PAGE) {
- return true // 明确表示允许路由继续执行
- }
- FG_LOG_ENABLE && console.log('1 isNeedLogin(白名单策略) url:', fullPath)
- toLoginPage({ queryString: redirectQuery })
- return false // 明确表示阻止原路由继续执行
- }
- }
- // #endregion 1/2 默认需要登录的情况(白名单策略) ---------------------------
-
- // #region 2/2 默认不需要登录的情况(黑名单策略) ---------------------------
- else {
- // 不需要登录里面的 EXCLUDE_LOGIN_PATH_LIST 表示黑名单,需要重定向到登录页
- if (judgeIsExcludePath(path)) {
- FG_LOG_ENABLE && console.log('2 isNeedLogin(黑名单策略) url:', fullPath)
- toLoginPage({ queryString: redirectQuery })
- return false // 修改为false,阻止原路由继续执行
- }
- return true // 明确表示允许路由继续执行
- }
- // #endregion 2/2 默认不需要登录的情况(黑名单策略) ---------------------------
},
}
diff --git a/src/store/index.ts b/src/store/index.ts
index 2f5a7c3..fe2ead1 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -16,6 +16,5 @@ setActivePinia(store)
export default store
// 模块统一导出
-export * from './theme'
export * from './token'
export * from './user'
diff --git a/src/store/theme.ts b/src/store/theme.ts
deleted file mode 100644
index c3f1c55..0000000
--- a/src/store/theme.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import type { ConfigProviderThemeVars } from 'wot-design-uni'
-
-import { defineStore } from 'pinia'
-
-export const useThemeStore = defineStore(
- 'theme-store',
- () => {
- /** 主题 */
- const theme = ref<'light' | 'dark'>('light')
-
- /** 主题变量 */
- const themeVars = ref({
- // colorTheme: 'red',
- // buttonPrimaryBgColor: '#07c160',
- // buttonPrimaryColor: '#07c160',
- })
-
- /** 设置主题变量 */
- const setThemeVars = (partialVars: Partial) => {
- themeVars.value = { ...themeVars.value, ...partialVars }
- }
-
- /** 切换主题 */
- const toggleTheme = () => {
- theme.value = theme.value === 'light' ? 'dark' : 'light'
- }
-
- return {
- /** 设置主题变量 */
- setThemeVars,
- /** 切换主题 */
- toggleTheme,
- /** 主题变量 */
- themeVars,
- /** 主题 */
- theme,
- }
- },
- {
- persist: true,
- },
-)
diff --git a/src/tabbar/index.vue b/src/tabbar/index.vue
index a18816f..e66de29 100644
--- a/src/tabbar/index.vue
+++ b/src/tabbar/index.vue
@@ -108,7 +108,7 @@ function getImageByIndex(index: number, item: CustomTabBarItem) {
-
+
diff --git a/src/tabbar/store.ts b/src/tabbar/store.ts
index 5b07cbd..c26b826 100644
--- a/src/tabbar/store.ts
+++ b/src/tabbar/store.ts
@@ -1,9 +1,6 @@
import type { CustomTabBarItem, CustomTabBarItemBadge } from './types'
import { reactive } from 'vue'
-import { isNeedLoginMode } from '@/router/config'
-import { FG_LOG_ENABLE, judgeIsExcludePath } from '@/router/interceptor'
-import { useTokenStore } from '@/store/token'
import { tabbarList as _tabbarList, customTabbarEnable, selectedTabbarStrategy, TABBAR_STRATEGY_MAP } from './config'
// TODO 1/2: 中间的鼓包tabbarItem的开关
@@ -41,12 +38,8 @@ const tabbarStore = reactive({
curIdx: uni.getStorageSync('app-tabbar-index') || 0,
prevIdx: uni.getStorageSync('app-tabbar-index') || 0,
setCurIdx(idx: number) {
- const tokenStore = useTokenStore()
- // 已登录 或 (url 需要登录 && 在白名单 || 不需要登录 && 不在黑名单) (关于 白名单|黑名单 逻辑: src/router/interceptor.ts)
- if (tokenStore.hasLogin || (isNeedLoginMode && judgeIsExcludePath(tabbarList[idx].pagePath)) || (!isNeedLoginMode && !judgeIsExcludePath(tabbarList[idx].pagePath))) {
- this.curIdx = idx
- uni.setStorageSync('app-tabbar-index', idx)
- }
+ this.curIdx = idx
+ uni.setStorageSync('app-tabbar-index', idx)
},
setTabbarItemBadge(idx: number, badge: CustomTabBarItemBadge) {
if (tabbarList[idx]) {
@@ -60,7 +53,6 @@ const tabbarStore = reactive({
return
}
const index = tabbarList.findIndex(item => item.pagePath === path)
- FG_LOG_ENABLE && console.log('index:', index, path)
// console.log('tabbarList:', tabbarList)
if (index === -1) {
const pagesPathList = getCurrentPages().map(item => item.route.startsWith('/') ? item.route : `/${item.route}`)
diff --git a/src/utils/toLoginPage.ts b/src/utils/toLoginPage.ts
index 5e2d316..de2f8dd 100644
--- a/src/utils/toLoginPage.ts
+++ b/src/utils/toLoginPage.ts
@@ -1,4 +1,3 @@
-import { LOGIN_PAGE } from '@/router/config'
import { getLastPage } from '@/utils'
import { debounce } from '@/utils/debounce'
@@ -15,6 +14,9 @@ interface ToLoginPageOptions {
queryString?: string
}
+// TODO: 自己增加登录页
+const LOGIN_PAGE = '/pages/login/index'
+
/**
* 跳转到登录页, 带防抖处理
*
diff --git a/tsconfig.json b/tsconfig.json
index 5085ff8..6a3ec97 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -15,7 +15,6 @@
"@uni-helper/uni-types",
"@uni-helper/vite-plugin-uni-pages",
"miniprogram-api-typings",
- "wot-design-uni/global.d.ts",
"z-paging/types",
"./src/types/async-component.d.ts",
"./src/types/async-import.d.ts",
diff --git a/vite.config.ts b/vite.config.ts
index 7624444..7a8a2a9 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -2,7 +2,6 @@ import path from 'node:path'
import process from 'node:process'
import Uni from '@uni-helper/plugin-uni'
import Components from '@uni-helper/vite-plugin-uni-components'
-import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'
// @see https://uni-helper.js.org/vite-plugin-uni-layouts
import UniLayouts from '@uni-helper/vite-plugin-uni-layouts'
// @see https://github.com/uni-helper/vite-plugin-uni-manifest
@@ -72,10 +71,7 @@ export default defineConfig(({ command, mode }) => {
exclude: ['**/components/**/**.*'],
// pages 目录为 src/pages,分包目录不能配置在pages目录下!!
// 是个数组,可以配置多个,但是不能为pages里面的目录!!
- subPackages: [
- 'src/pages-fg', // 这个是相对必要的路由,尽量留着(登录页、注册页、404页等)
- 'src/pages-sub', // 这个多为示例代码,参考用的,开发完后注释掉即可(或者直接删除)
- ],
+ subPackages: [],
dts: 'src/types/uni-pages.d.ts',
}),
// Optimization 插件需要 page.json 文件,故应在 UniPages 插件之后执行
@@ -144,7 +140,6 @@ export default defineConfig(({ command, mode }) => {
),
syncManifestPlugin(),
Components({
- resolvers: [WotResolver()],
extensions: ['vue'],
deep: true, // 是否递归扫描子目录,
directoryAsNamespace: false, // 是否把目录名作为命名空间前缀,true 时组件名为 目录名+组件名,