feat: 优化项目整体和更新相关依赖

This commit is contained in:
fonghehe 2025-02-19 18:16:32 +08:00
parent 6421aecf77
commit 1f9a7d5cd4
24 changed files with 22570 additions and 33084 deletions

View File

@ -1,7 +1,14 @@
# 是否开启数据mock
VITE_USE_MOCK=true
# 是否开启调试工具
VITE_USE_ERUDA=false
# 是否开启压缩
VITE_USE_COMPRESS=false
# 是否开启打包后生成报告
VITE_USE_REPORT=false
# 是否开启https
VITE_USE_HTTPS=false

View File

@ -1,7 +1,14 @@
# 是否开启数据mock
VITE_USE_MOCK=true
# 是否开启调试工具
VITE_USE_ERUDA=false
# 是否开启压缩
VITE_USE_COMPRESS=true
# 是否开启打包后生成报告
VITE_USE_REPORT=false
# 是否开启https
VITE_USE_HTTPS=false

View File

@ -1,7 +1,14 @@
# 是否开启数据mock
VITE_USE_MOCK=true
# 是否开启调试工具
VITE_USE_ERUDA=true
# 是否开启压缩
VITE_USE_COMPRESS=true
# 是否开启打包后生成报告
VITE_USE_REPORT=false
# 是否开启https
VITE_USE_HTTPS=false

View File

@ -1,15 +0,0 @@
*.sh
node_modules
*.md
*.woff
*.ttf
.vscode
.idea
dist
/public
/docs
.husky
.local
/bin
Dockerfile

View File

@ -75,6 +75,17 @@
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"toValue": true
"toValue": true,
"DirectiveBinding": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"MaybeRef": true,
"MaybeRefOrGetter": true,
"WritableComputedRef": true,
"onWatcherCleanup": true,
"useId": true,
"useModel": true,
"useTemplateRef": true
}
}

View File

@ -105,6 +105,7 @@
"cSpell.words": [
"antd",
"antv",
"axios",
"brotli",
"browserslist",
"codemirror",
@ -114,6 +115,7 @@
"ERUDA",
"esnext",
"esno",
"iconfont",
"iconify",
"INTLIFY",
"lint-staged",
@ -122,6 +124,7 @@
"mkcert",
"mockjs",
"nprogress",
"nutui",
"persistedstate",
"pinia",
"pnpm",
@ -134,6 +137,7 @@
"tinymce",
"unocss",
"unplugin",
"vant",
"vben",
"vditor",
"Vite",

View File

@ -21,7 +21,7 @@ import { ConfigVisualizerConfig } from './visualizer';
import basicSsl from '@vitejs/plugin-basic-ssl';
export function createVitePlugins(env: ViteEnv, isBuild: boolean) {
const { VITE_USE_MOCK, VITE_USE_ERUDA, VITE_USE_COMPRESS, VITE_USE_REPORT } = env;
const { VITE_USE_MOCK, VITE_USE_ERUDA, VITE_USE_COMPRESS, VITE_USE_REPORT, VITE_USE_HTTPS } = env;
const vitePlugins: (PluginOption | PluginOption[])[] = [
// vue支持
@ -59,7 +59,7 @@ export function createVitePlugins(env: ViteEnv, isBuild: boolean) {
// vite-plugin-svg-icons
vitePlugins.push(ConfigSvgIconsPlugin(isBuild));
vitePlugins.push(basicSsl());
VITE_USE_HTTPS && vitePlugins.push(basicSsl());
if (isBuild) {
// vite-plugin-imagemin

View File

@ -1,5 +1,8 @@
module.exports = {
root: true,
// eslint.config.js
import { defineConfig } from 'eslint-define-config';
export default defineConfig({
env: {
browser: true,
node: true,
@ -18,18 +21,20 @@ module.exports = {
createDefaultProgram: false,
extraFileExtensions: ['.vue'],
},
extends: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
extends: [
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['vue', '@typescript-eslint', 'import'],
rules: {
'no-unused-vars': 'off',
'no-case-declarations': 'off',
'no-use-before-define': 'off',
'space-before-function-paren': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
@ -74,4 +79,20 @@ module.exports = {
'vue/multi-word-component-names': 'off',
},
globals: { defineOptions: 'readonly' },
};
ignores: [
'**/*.sh',
'node_modules',
'**/*.md',
'**/*.woff',
'**/*.ttf',
'.vscode',
'.idea',
'dist',
'public',
'docs',
'.husky',
'.local',
'bin',
'Dockerfile',
],
});

View File

@ -1,6 +1,6 @@
import { MockMethod, Recordable } from 'vite-plugin-mock';
interface response {
interface Response {
body: Recordable;
query: Recordable;
}
@ -9,7 +9,7 @@ export default [
{
url: '/api/login',
method: 'post',
response: ({ body, query }: response) => {
response: ({ body, query }: Response) => {
console.log('body>>>>>>>>', body);
console.log('query>>>>>>>>', query);
return {

28286
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,58 +15,58 @@
},
"dependencies": {
"@nutui/icons-vue": "^0.1.1",
"@nutui/nutui": "^4.1.0",
"@varlet/ui": "^2.13.0",
"@vueuse/core": "10.2.1",
"@vueuse/integrations": "10.2.1",
"axios": "1.4.0",
"dayjs": "^1.11.9",
"@nutui/nutui": "^4.3.13",
"@varlet/ui": "^3.8.7",
"@vueuse/core": "12.7.0",
"@vueuse/integrations": "12.7.0",
"axios": "1.7.9",
"dayjs": "^1.11.13",
"mitt": "^3.0.1",
"pinia": "^2.1.3",
"pinia-plugin-persistedstate": "^3.1.0",
"quarkd": "^1.0.70",
"universal-cookie": "^4.0.4",
"vant": "^4.6.2",
"vue": "^3.3.1",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.4"
"pinia": "^3.0.1",
"pinia-plugin-persistedstate": "^4.2.0",
"quarkd": "^2.0.5",
"universal-cookie": "^7.2.2",
"vant": "^4.9.17",
"vue": "^3.5.13",
"vue-i18n": "^11.1.1",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.6",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"@vitejs/plugin-legacy": "^4.1.0",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@commitlint/cli": "^19.7.1",
"@commitlint/config-conventional": "^19.7.1",
"@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-legacy": "^6.0.1",
"@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^4.1.1",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.4.0",
"@vue/test-utils": "^2.4.0",
"@vue/tsconfig": "^0.4.0",
"@vue/tsconfig": "^0.7.0",
"amfe-flexible": "^2.2.1",
"autoprefixer": "^10.4.14",
"cnjm-postcss-px-to-viewport": "^1.0.0",
"autoprefixer": "^10.4.20",
"cnjm-postcss-px-to-viewport": "^1.0.1",
"consola": "^3.2.3",
"cross-env": "^7.0.3",
"cz-git": "^1.7.0",
"czg": "^1.7.0",
"eruda": "^3.0.0",
"eslint": "^8.45.0",
"eslint-config-prettier": "^8.8.0",
"eslint-define-config": "^1.21.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.15.1",
"cz-git": "^1.11.0",
"czg": "^1.11.0",
"eruda": "^3.4.1",
"eslint": "^9.20.1",
"eslint-config-prettier": "^10.0.1",
"eslint-define-config": "^2.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-vue": "^9.32.0",
"git-cz": "^4.9.0",
"husky": "8.0.3",
"husky": "9.1.7",
"jsdom": "^22.1.0",
"lint-staged": "13.2.3",
"lint-staged": "15.4.3",
"mockjs": "^1.1.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.26",
"postcss-html": "1.5.0",
"postcss": "^8.5.2",
"postcss-html": "1.8.0",
"postcss-less": "^6.0.0",
"prettier": "^3.0.0",
"prettier": "^3.5.1",
"rollup-plugin-visualizer": "^5.9.1",
"stylelint": "^15.10.1",
"stylelint-config-property-sort-order-smacss": "^9.1.0",
@ -77,22 +77,26 @@
"stylelint-order": "^6.0.3",
"stylelint-prettier": "^4.0.0",
"terser": "^5.19.0",
"typescript": "^5.1.6",
"unplugin-auto-import": "^0.16.6",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.4.4",
"typescript": "^5.7.3",
"unplugin-auto-import": "^19.1.0",
"unplugin-vue-components": "^28.2.0",
"vite": "^6.1.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-eruda": "^1.0.1",
"vite-plugin-imagemin": "^0.6.1",
"vite-plugin-mock": "^3.0.0",
"vite-plugin-pages": "^0.31.0",
"vite-plugin-mock": "^3.0.2",
"vite-plugin-pages": "^0.32.4",
"vite-plugin-progress": "^0.0.7",
"vite-plugin-restart": "^0.3.1",
"vite-plugin-restart": "^0.4.2",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-setup-extend-plus": "^0.1.0",
"vitest": "^0.33.0",
"vue-eslint-parser": "^9.3.1",
"vue-tsc": "^1.8.5"
"vitest": "^3.0.5",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^2.2.2"
},
"engines": {
"node": ">=20.10.0",
"pnpm": ">=9.12.0"
},
"husky": {
"hooks": {

17127
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -10,8 +10,7 @@ interface StoreUser {
info: Record<any, any>;
}
export const useUserStore = defineStore({
id: 'app-user',
export const useUserStore = defineStore('user', {
state: (): StoreUser => ({
token: token,
info: {},
@ -23,20 +22,22 @@ export const useUserStore = defineStore({
},
actions: {
setInfo(info: any) {
this.info = info ? info : '';
this.info = info ?? '';
},
login() {
return new Promise((resolve) => {
loginPassword().then((res) => {
this.setInfo(res);
resolve(res);
});
});
async login() {
try {
const res = await loginPassword(); // 调用登录接口
this.setInfo(res); // 设置用户信息
this.token = res.token; // 假设返回的 res 包含 token
return res;
} catch (error) {
console.error('Login failed', error);
throw error;
}
},
},
persist: {
key: 'token',
pick: ['token'],
storage: localStorage,
paths: ['token'],
},
});

View File

@ -22,7 +22,7 @@ service.interceptors.response.use(
showToast(res.msg);
return Promise.reject(res.msg || 'Error');
} else {
return res;
return res.data;
}
},
(error: AxiosError) => {

View File

@ -1,6 +1,6 @@
<template>
<header class="header">
<img src="https://cdn.jsdelivr.net/gh/fonghehe/picture/vue-h5-template/logo.png" /><span> {{ $t('title') }}</span>
<img src="https://cdn.jsdelivr.net/gh/fonghehe/picture/vue-h5-template/logo.png" alt="" /><span> {{ $t('title') }}</span>
</header>
<div class="intro-header">
<div>{{ $t('introduction') }}</div>
@ -28,12 +28,9 @@
{{ $t('language.en') }}
</nut-button>
</div>
{{ getUserInfo }}
</template>
<script lang="ts" setup name="HomePage">
import { computed } from 'vue';
import { useUserStore } from '@/store/modules/user';
import { setLang } from '@/i18n';
import { useI18n } from 'vue-i18n';
import { Github, Check } from '@nutui/icons-vue';
@ -41,11 +38,6 @@
const { locale } = useI18n();
let cellList = ['vue3', 'vite', 'vue-router', 'axios', 'Pinia', 'vue-i18n', 'postcss-px-to-viewport', 'varlet / vant / nutUI', 'eruda'];
const userStore = useUserStore();
const getUserInfo = computed(() => {
const { name = '' } = userStore.getUserInfo || {};
return name;
});
const changeLang = (type) => {
setLang(type);
@ -56,7 +48,7 @@
display: flex;
align-items: center;
justify-content: center;
padding: 0 20px;
padding: 10px 20px;
font-size: 40px;
img {
@ -70,7 +62,7 @@
align-items: center;
justify-content: center;
margin-top: 20px;
font-size: 16px;
font-size: 24px;
}
.supportList {

View File

@ -15,6 +15,7 @@
<script lang="ts" setup name="ListPage">
import { listData } from './data';
const router = useRouter();
let list = ref(listData);

View File

@ -2,11 +2,11 @@
<div class="login">
<h2>登录</h2>
<nut-form ref="ruleForm" :model-value="formData">
<nut-form-item required prop="name" :rules="[{ required: true, message: '请输入用户名' }]">
<input v-model="formData.name" class="nut-input-text" placeholder="请输入用户名" type="text" />
<nut-form-item label="用户名" required prop="name" :rules="[{ required: true, message: '请输入用户名' }]">
<nut-input v-model="formData.name" placeholder="请输入用户名" type="text" />
</nut-form-item>
<nut-form-item required prop="pwd" :rules="[{ required: true, message: '请填写联系电话' }]">
<input v-model="formData.pwd" class="nut-input-text" placeholder="请输入密码" type="password" />
<nut-form-item label="密码" required prop="pwd" :rules="[{ required: true, message: '请输入密码' }]">
<nut-input v-model="formData.pwd" placeholder="请输入密码" type="password" />
</nut-form-item>
<nut-button block type="info" @click="submit"> 登录 </nut-button>
</nut-form>
@ -28,6 +28,7 @@
ruleForm.value.validate().then(async ({ valid, errors }: any) => {
if (valid) {
const userInfo = await userStore.login();
console.log(userInfo);
if (userInfo) {
router.push({ path: '/home' });
}

View File

@ -4,7 +4,10 @@
<img src="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png" />
</nut-avatar>
<div class="member-detail">
<p class="nickname"> 昵称<nut-button shape="square" size="small" type="default" @click="goLogin"> 去登录 </nut-button> </p>
<p class="nickname">
<span v-if="getUserInfo">用户名:{{ getUserInfo }}</span
><nut-button v-else shape="square" size="small" type="default" @click="goLogin"> 去登录 </nut-button>
</p>
<p class="info"> 个人其他信息后续补充.... </p>
</div>
</div>
@ -14,16 +17,16 @@
</template>
<script lang="ts" setup name="MemberPage">
// import { useUserStore } from '@/store/modules/user';
import { useUserStore } from '@/store/modules/user';
import { useRouter } from 'vue-router';
import { Dongdong } from '@nutui/icons-vue';
const router = useRouter();
// const userStore = useUserStore();
// const getUserInfo = computed(() => {
// const { name = '' } = userStore.getUserInfo || {};
// return name;
// });
const userStore = useUserStore();
const getUserInfo = computed(() => {
const { name = '' } = userStore.getUserInfo || {};
return name;
});
const goLogin = () => {
router.push('/login');
};
@ -32,20 +35,24 @@
<style lang="scss">
.avatar-wrap {
display: flex;
margin: 10px 40px;
align-items: center;
margin: 10px 40px;
.member-detail {
margin-left: 20px;
.nickname {
font-size: 16px;
font-size: 32px;
font-weight: bold;
.nut-button {
margin-left: 10px;
}
}
.info {
margin-top: 10px;
font-size: 16px;
font-size: 24px;
}
}
}

View File

@ -3,80 +3,101 @@
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope'];
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'];
const computed: typeof import('vue')['computed'];
const createApp: typeof import('vue')['createApp'];
const createPinia: typeof import('pinia')['createPinia'];
const customRef: typeof import('vue')['customRef'];
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'];
const defineComponent: typeof import('vue')['defineComponent'];
const defineStore: typeof import('pinia')['defineStore'];
const effectScope: typeof import('vue')['effectScope'];
const getActivePinia: typeof import('pinia')['getActivePinia'];
const getCurrentInstance: typeof import('vue')['getCurrentInstance'];
const getCurrentScope: typeof import('vue')['getCurrentScope'];
const h: typeof import('vue')['h'];
const inject: typeof import('vue')['inject'];
const isProxy: typeof import('vue')['isProxy'];
const isReactive: typeof import('vue')['isReactive'];
const isReadonly: typeof import('vue')['isReadonly'];
const isRef: typeof import('vue')['isRef'];
const mapActions: typeof import('pinia')['mapActions'];
const mapGetters: typeof import('pinia')['mapGetters'];
const mapState: typeof import('pinia')['mapState'];
const mapStores: typeof import('pinia')['mapStores'];
const mapWritableState: typeof import('pinia')['mapWritableState'];
const markRaw: typeof import('vue')['markRaw'];
const nextTick: typeof import('vue')['nextTick'];
const onActivated: typeof import('vue')['onActivated'];
const onBeforeMount: typeof import('vue')['onBeforeMount'];
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'];
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'];
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'];
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'];
const onDeactivated: typeof import('vue')['onDeactivated'];
const onErrorCaptured: typeof import('vue')['onErrorCaptured'];
const onMounted: typeof import('vue')['onMounted'];
const onRenderTracked: typeof import('vue')['onRenderTracked'];
const onRenderTriggered: typeof import('vue')['onRenderTriggered'];
const onScopeDispose: typeof import('vue')['onScopeDispose'];
const onServerPrefetch: typeof import('vue')['onServerPrefetch'];
const onUnmounted: typeof import('vue')['onUnmounted'];
const onUpdated: typeof import('vue')['onUpdated'];
const provide: typeof import('vue')['provide'];
const reactive: typeof import('vue')['reactive'];
const readonly: typeof import('vue')['readonly'];
const ref: typeof import('vue')['ref'];
const resolveComponent: typeof import('vue')['resolveComponent'];
const setActivePinia: typeof import('pinia')['setActivePinia'];
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'];
const shallowReactive: typeof import('vue')['shallowReactive'];
const shallowReadonly: typeof import('vue')['shallowReadonly'];
const shallowRef: typeof import('vue')['shallowRef'];
const storeToRefs: typeof import('pinia')['storeToRefs'];
const toRaw: typeof import('vue')['toRaw'];
const toRef: typeof import('vue')['toRef'];
const toRefs: typeof import('vue')['toRefs'];
const toValue: typeof import('vue')['toValue'];
const triggerRef: typeof import('vue')['triggerRef'];
const unref: typeof import('vue')['unref'];
const useAttrs: typeof import('vue')['useAttrs'];
const useCssModule: typeof import('vue')['useCssModule'];
const useCssVars: typeof import('vue')['useCssVars'];
const useLink: typeof import('vue-router')['useLink'];
const useRoute: typeof import('vue-router')['useRoute'];
const useRouter: typeof import('vue-router')['useRouter'];
const useSlots: typeof import('vue')['useSlots'];
const watch: typeof import('vue')['watch'];
const watchEffect: typeof import('vue')['watchEffect'];
const watchPostEffect: typeof import('vue')['watchPostEffect'];
const watchSyncEffect: typeof import('vue')['watchSyncEffect'];
const EffectScope: (typeof import('vue'))['EffectScope'];
const acceptHMRUpdate: (typeof import('pinia'))['acceptHMRUpdate'];
const computed: (typeof import('vue'))['computed'];
const createApp: (typeof import('vue'))['createApp'];
const createPinia: (typeof import('pinia'))['createPinia'];
const customRef: (typeof import('vue'))['customRef'];
const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent'];
const defineComponent: (typeof import('vue'))['defineComponent'];
const defineStore: (typeof import('pinia'))['defineStore'];
const effectScope: (typeof import('vue'))['effectScope'];
const getActivePinia: (typeof import('pinia'))['getActivePinia'];
const getCurrentInstance: (typeof import('vue'))['getCurrentInstance'];
const getCurrentScope: (typeof import('vue'))['getCurrentScope'];
const h: (typeof import('vue'))['h'];
const inject: (typeof import('vue'))['inject'];
const isProxy: (typeof import('vue'))['isProxy'];
const isReactive: (typeof import('vue'))['isReactive'];
const isReadonly: (typeof import('vue'))['isReadonly'];
const isRef: (typeof import('vue'))['isRef'];
const mapActions: (typeof import('pinia'))['mapActions'];
const mapGetters: (typeof import('pinia'))['mapGetters'];
const mapState: (typeof import('pinia'))['mapState'];
const mapStores: (typeof import('pinia'))['mapStores'];
const mapWritableState: (typeof import('pinia'))['mapWritableState'];
const markRaw: (typeof import('vue'))['markRaw'];
const nextTick: (typeof import('vue'))['nextTick'];
const onActivated: (typeof import('vue'))['onActivated'];
const onBeforeMount: (typeof import('vue'))['onBeforeMount'];
const onBeforeRouteLeave: (typeof import('vue-router'))['onBeforeRouteLeave'];
const onBeforeRouteUpdate: (typeof import('vue-router'))['onBeforeRouteUpdate'];
const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount'];
const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate'];
const onDeactivated: (typeof import('vue'))['onDeactivated'];
const onErrorCaptured: (typeof import('vue'))['onErrorCaptured'];
const onMounted: (typeof import('vue'))['onMounted'];
const onRenderTracked: (typeof import('vue'))['onRenderTracked'];
const onRenderTriggered: (typeof import('vue'))['onRenderTriggered'];
const onScopeDispose: (typeof import('vue'))['onScopeDispose'];
const onServerPrefetch: (typeof import('vue'))['onServerPrefetch'];
const onUnmounted: (typeof import('vue'))['onUnmounted'];
const onUpdated: (typeof import('vue'))['onUpdated'];
const onWatcherCleanup: (typeof import('vue'))['onWatcherCleanup'];
const provide: (typeof import('vue'))['provide'];
const reactive: (typeof import('vue'))['reactive'];
const readonly: (typeof import('vue'))['readonly'];
const ref: (typeof import('vue'))['ref'];
const resolveComponent: (typeof import('vue'))['resolveComponent'];
const setActivePinia: (typeof import('pinia'))['setActivePinia'];
const setMapStoreSuffix: (typeof import('pinia'))['setMapStoreSuffix'];
const shallowReactive: (typeof import('vue'))['shallowReactive'];
const shallowReadonly: (typeof import('vue'))['shallowReadonly'];
const shallowRef: (typeof import('vue'))['shallowRef'];
const storeToRefs: (typeof import('pinia'))['storeToRefs'];
const toRaw: (typeof import('vue'))['toRaw'];
const toRef: (typeof import('vue'))['toRef'];
const toRefs: (typeof import('vue'))['toRefs'];
const toValue: (typeof import('vue'))['toValue'];
const triggerRef: (typeof import('vue'))['triggerRef'];
const unref: (typeof import('vue'))['unref'];
const useAttrs: (typeof import('vue'))['useAttrs'];
const useCssModule: (typeof import('vue'))['useCssModule'];
const useCssVars: (typeof import('vue'))['useCssVars'];
const useId: (typeof import('vue'))['useId'];
const useLink: (typeof import('vue-router'))['useLink'];
const useModel: (typeof import('vue'))['useModel'];
const useRoute: (typeof import('vue-router'))['useRoute'];
const useRouter: (typeof import('vue-router'))['useRouter'];
const useSlots: (typeof import('vue'))['useSlots'];
const useTemplateRef: (typeof import('vue'))['useTemplateRef'];
const watch: (typeof import('vue'))['watch'];
const watchEffect: (typeof import('vue'))['watchEffect'];
const watchPostEffect: (typeof import('vue'))['watchPostEffect'];
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';
export type {
Component,
ComponentPublicInstance,
ComputedRef,
DirectiveBinding,
ExtractDefaultPropTypes,
ExtractPropTypes,
ExtractPublicPropTypes,
InjectionKey,
PropType,
Ref,
MaybeRef,
MaybeRefOrGetter,
VNode,
WritableComputedRef,
} from 'vue';
import('vue');
}

45
types/components.d.ts vendored
View File

@ -1,31 +1,32 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}
export {};
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
BasicModal: typeof import('./../src/components/Modal/src/BasicModal.vue')['default'];
NutAvatar: typeof import('@nutui/nutui')['Avatar'];
NutButton: typeof import('@nutui/nutui')['Button'];
NutCard: typeof import('@nutui/nutui')['Card'];
NutCell: typeof import('@nutui/nutui')['Cell'];
NutCellGroup: typeof import('@nutui/nutui')['CellGroup'];
NutForm: typeof import('@nutui/nutui')['Form'];
NutFormItem: typeof import('@nutui/nutui')['FormItem'];
NutGrid: typeof import('@nutui/nutui')['Grid'];
NutGridItem: typeof import('@nutui/nutui')['GridItem'];
NutSwiper: typeof import('@nutui/nutui')['Swiper'];
NutSwiperItem: typeof import('@nutui/nutui')['SwiperItem'];
NutTabbar: typeof import('@nutui/nutui')['Tabbar'];
NutTabbarItem: typeof import('@nutui/nutui')['TabbarItem'];
RouterLink: typeof import('vue-router')['RouterLink'];
RouterView: typeof import('vue-router')['RouterView'];
VanButton: typeof import('vant/es')['Button'];
VanNavBar: typeof import('vant/es')['NavBar'];
VarButton: typeof import('@varlet/ui')['_ButtonComponent'];
VarSpace: typeof import('@varlet/ui')['_SpaceComponent'];
BasicModal: typeof import('./../src/components/Modal/src/BasicModal.vue')['default']
NutAvatar: typeof import('@nutui/nutui')['Avatar']
NutButton: typeof import('@nutui/nutui')['Button']
NutCard: typeof import('@nutui/nutui')['Card']
NutCell: typeof import('@nutui/nutui')['Cell']
NutCellGroup: typeof import('@nutui/nutui')['CellGroup']
NutForm: typeof import('@nutui/nutui')['Form']
NutFormItem: typeof import('@nutui/nutui')['FormItem']
NutGrid: typeof import('@nutui/nutui')['Grid']
NutGridItem: typeof import('@nutui/nutui')['GridItem']
NutInput: typeof import('@nutui/nutui')['Input']
NutSwiper: typeof import('@nutui/nutui')['Swiper']
NutSwiperItem: typeof import('@nutui/nutui')['SwiperItem']
NutTabbar: typeof import('@nutui/nutui')['Tabbar']
NutTabbarItem: typeof import('@nutui/nutui')['TabbarItem']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
VanButton: typeof import('vant/es')['Button']
VanNavBar: typeof import('vant/es')['NavBar']
VarButton: typeof import('@varlet/ui')['_ButtonComponent']
VarSpace: typeof import('@varlet/ui')['_SpaceComponent']
}
}

1
types/global.d.ts vendored
View File

@ -50,6 +50,7 @@ declare global {
VITE_USE_ERUDA: Boolean;
VITE_USE_COMPRESS: Boolean;
VITE_USE_REPORT: Boolean;
VITE_USE_HTTPS: Boolean;
}
declare function parseInt(s: string | number, radix?: number): number;

View File

@ -38,7 +38,6 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
server: {
host: true,
hmr: true,
https: true,
},
plugins: createVitePlugins(viteEnv, isProduction),
build: {
@ -55,7 +54,7 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
preprocessorOptions: {
scss: {
// 配置 nutui 全局 scss 变量
additionalData: `@import "@nutui/nutui/dist/styles/variables.scss";@import '@/styles/mixin.scss'; @import '@/styles/vant.scss';`,
additionalData: `@use "@nutui/nutui/dist/styles/variables.scss";@use '@/styles/mixin.scss'; @use '@/styles/vant.scss';`,
},
},
},

9749
yarn.lock

File diff suppressed because it is too large Load Diff