fix: 修改vant的引入问题和更新依赖

This commit is contained in:
fonghehe 2023-02-08 17:56:45 +08:00
parent 06f521a4b6
commit f6bbe4d396
10 changed files with 1007 additions and 505 deletions

View File

@ -16,7 +16,6 @@ import { ConfigPagesPlugin } from './pages';
import { ConfigRestartPlugin } from './restart'; import { ConfigRestartPlugin } from './restart';
import { ConfigProgressPlugin } from './progress'; import { ConfigProgressPlugin } from './progress';
import { ConfigEruda } from './eruda'; import { ConfigEruda } from './eruda';
import { ConfigStyleImport } from './styleImport';
import { ConfigImageminPlugin } from './imagemin'; import { ConfigImageminPlugin } from './imagemin';
import { ConfigVisualizerConfig } from './visualizer'; import { ConfigVisualizerConfig } from './visualizer';
@ -50,9 +49,6 @@ export function createVitePlugins(env: ViteEnv, isBuild: boolean) {
// 构建时显示进度条 // 构建时显示进度条
vitePlugins.push(ConfigProgressPlugin()); vitePlugins.push(ConfigProgressPlugin());
//styleImport
vitePlugins.push(ConfigStyleImport());
// eruda // eruda
VITE_USE_ERUDA && vitePlugins.push(ConfigEruda()); VITE_USE_ERUDA && vitePlugins.push(ConfigEruda());

View File

@ -1,12 +0,0 @@
/**
* @name ConfigRestartPlugin
* @description
*/
import { createStyleImportPlugin, VantResolve } from 'vite-plugin-style-import';
export const ConfigStyleImport = () => {
return createStyleImportPlugin({
resolves: [VantResolve()],
});
};

View File

@ -18,10 +18,10 @@
}, },
"dependencies": { "dependencies": {
"@nutui/nutui": "^4.0.0", "@nutui/nutui": "^4.0.0",
"@varlet/ui": "^2.7.3", "@varlet/ui": "^2.7.4",
"@vueuse/core": "9.12.0", "@vueuse/core": "9.12.0",
"@vueuse/integrations": "9.12.0", "@vueuse/integrations": "9.12.0",
"axios": "1.3.1", "axios": "1.3.2",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"mitt": "^3.0.0", "mitt": "^3.0.0",
"pinia": "^2.0.30", "pinia": "^2.0.30",
@ -43,7 +43,7 @@
"cnjm-postcss-px-to-viewport": "^1.0.0", "cnjm-postcss-px-to-viewport": "^1.0.0",
"consola": "^2.15.3", "consola": "^2.15.3",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eruda": "^2.11.0", "eruda": "^2.11.2",
"eslint": "^8.33.0", "eslint": "^8.33.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
@ -65,9 +65,9 @@
"stylelint-order": "^6.0.0", "stylelint-order": "^6.0.0",
"terser": "^5.16.3", "terser": "^5.16.3",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"unplugin-auto-import": "^0.12.2", "unplugin-auto-import": "^0.14.2",
"unplugin-vue-components": "^0.22.12", "unplugin-vue-components": "^0.23.0",
"vite": "^4.0.4", "vite": "^4.1.1",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-eruda": "^1.0.1", "vite-plugin-eruda": "^1.0.1",
"vite-plugin-imagemin": "^0.6.1", "vite-plugin-imagemin": "^0.6.1",
@ -75,7 +75,6 @@
"vite-plugin-pages": "^0.28.0", "vite-plugin-pages": "^0.28.0",
"vite-plugin-progress": "^0.0.6", "vite-plugin-progress": "^0.0.6",
"vite-plugin-restart": "^0.3.1", "vite-plugin-restart": "^0.3.1",
"vite-plugin-style-import": "^2.0.0",
"vite-plugin-svg-icons": "^2.0.1", "vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-setup-extend": "^0.4.0", "vite-plugin-vue-setup-extend": "^0.4.0",
"vue-eslint-parser": "^9.1.0", "vue-eslint-parser": "^9.1.0",

644
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,6 @@
watch( watch(
() => router, () => router,
() => { () => {
console.log(tabItem.findIndex((item) => item.key === router.currentRoute.value.path.replace('/', '')));
const judgeRoute = tabItem.some((item) => item.key === router.currentRoute.value.path.replace('/', '')); const judgeRoute = tabItem.some((item) => item.key === router.currentRoute.value.path.replace('/', ''));
activeTab.value = tabItem.findIndex((item) => item.key === router.currentRoute.value.path.replace('/', '')); activeTab.value = tabItem.findIndex((item) => item.key === router.currentRoute.value.path.replace('/', ''));
tabbarVisible.value = judgeRoute; tabbarVisible.value = judgeRoute;

View File

@ -1,6 +1,7 @@
import { useAxios } from '@vueuse/integrations/useAxios'; import { useAxios } from '@vueuse/integrations/useAxios';
import axios from 'axios'; import axios from 'axios';
import { showToast } from 'vant/lib/toast'; import { showToast } from 'vant';
import 'vant/es/toast/style';
// create an axios instance // create an axios instance
const instance = axios.create({ const instance = axios.create({

View File

@ -13,11 +13,9 @@ const useFetchApi = createFetch({
return { options }; return { options };
}, },
afterFetch(ctx) { afterFetch(ctx) {
console.log(ctx);
const { data, response } = ctx; const { data, response } = ctx;
if (response.status >= 200 && response.status < 300) { if (response.status >= 200 && response.status < 300) {
try { try {
console.log(response);
const jsonObj = data; const jsonObj = data;
if (jsonObj.code != 200) { if (jsonObj.code != 200) {
showNotify({ type: 'danger', message: jsonObj.message || 'Error' }); showNotify({ type: 'danger', message: jsonObj.message || 'Error' });

View File

@ -8,7 +8,7 @@
<p class="info"> 个人其他信息后续补充.... </p> <p class="info"> 个人其他信息后续补充.... </p>
</div> </div>
</div> </div>
<nut-grid> <nut-grid direction="vertical">
<nut-grid-item v-for="item in 10" :key="item" text="文字"><Dongdong /></nut-grid-item> <nut-grid-item v-for="item in 10" :key="item" text="文字"><Dongdong /></nut-grid-item>
</nut-grid> </nut-grid>
</template> </template>

View File

@ -47,7 +47,6 @@ declare global {
const readonly: typeof import('vue')['readonly']; const readonly: typeof import('vue')['readonly'];
const ref: typeof import('vue')['ref']; const ref: typeof import('vue')['ref'];
const resolveComponent: typeof import('vue')['resolveComponent']; const resolveComponent: typeof import('vue')['resolveComponent'];
const resolveDirective: typeof import('vue')['resolveDirective'];
const setActivePinia: typeof import('pinia')['setActivePinia']; const setActivePinia: typeof import('pinia')['setActivePinia'];
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']; const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'];
const shallowReactive: typeof import('vue')['shallowReactive']; const shallowReactive: typeof import('vue')['shallowReactive'];
@ -71,3 +70,8 @@ declare global {
const watchPostEffect: typeof import('vue')['watchPostEffect']; const watchPostEffect: typeof import('vue')['watchPostEffect'];
const watchSyncEffect: typeof import('vue')['watchSyncEffect']; const watchSyncEffect: typeof import('vue')['watchSyncEffect'];
} }
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue';
}

825
yarn.lock

File diff suppressed because it is too large Load Diff