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_MOCK=true
# 是否开启调试工具
VITE_USE_ERUDA=false VITE_USE_ERUDA=false
# 是否开启压缩
VITE_USE_COMPRESS=false VITE_USE_COMPRESS=false
VITE_USE_REPORT=false # 是否开启打包后生成报告
VITE_USE_REPORT=false
# 是否开启https
VITE_USE_HTTPS=false

View File

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

View File

@ -1,7 +1,14 @@
# 是否开启数据mock
VITE_USE_MOCK=true VITE_USE_MOCK=true
# 是否开启调试工具
VITE_USE_ERUDA=true VITE_USE_ERUDA=true
# 是否开启压缩
VITE_USE_COMPRESS=true VITE_USE_COMPRESS=true
VITE_USE_REPORT=false # 是否开启打包后生成报告
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, "watchEffect": true,
"watchPostEffect": true, "watchPostEffect": true,
"watchSyncEffect": 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": [ "cSpell.words": [
"antd", "antd",
"antv", "antv",
"axios",
"brotli", "brotli",
"browserslist", "browserslist",
"codemirror", "codemirror",
@ -114,6 +115,7 @@
"ERUDA", "ERUDA",
"esnext", "esnext",
"esno", "esno",
"iconfont",
"iconify", "iconify",
"INTLIFY", "INTLIFY",
"lint-staged", "lint-staged",
@ -122,6 +124,7 @@
"mkcert", "mkcert",
"mockjs", "mockjs",
"nprogress", "nprogress",
"nutui",
"persistedstate", "persistedstate",
"pinia", "pinia",
"pnpm", "pnpm",
@ -134,6 +137,7 @@
"tinymce", "tinymce",
"unocss", "unocss",
"unplugin", "unplugin",
"vant",
"vben", "vben",
"vditor", "vditor",
"Vite", "Vite",

View File

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

View File

@ -1,5 +1,8 @@
module.exports = { // eslint.config.js
root: true,
import { defineConfig } from 'eslint-define-config';
export default defineConfig({
env: { env: {
browser: true, browser: true,
node: true, node: true,
@ -18,18 +21,20 @@ module.exports = {
createDefaultProgram: false, createDefaultProgram: false,
extraFileExtensions: ['.vue'], 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'], plugins: ['vue', '@typescript-eslint', 'import'],
rules: { rules: {
'no-unused-vars': 'off', 'no-unused-vars': 'off',
'no-case-declarations': 'off', 'no-case-declarations': 'off',
'no-use-before-define': 'off', 'no-use-before-define': 'off',
'space-before-function-paren': 'off', 'space-before-function-paren': 'off',
'import/first': 'error', 'import/first': 'error',
'import/newline-after-import': 'error', 'import/newline-after-import': 'error',
'import/no-duplicates': 'error', 'import/no-duplicates': 'error',
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
'error', 'error',
{ {
@ -74,4 +79,20 @@ module.exports = {
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
}, },
globals: { defineOptions: 'readonly' }, 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'; import { MockMethod, Recordable } from 'vite-plugin-mock';
interface response { interface Response {
body: Recordable; body: Recordable;
query: Recordable; query: Recordable;
} }
@ -9,7 +9,7 @@ export default [
{ {
url: '/api/login', url: '/api/login',
method: 'post', method: 'post',
response: ({ body, query }: response) => { response: ({ body, query }: Response) => {
console.log('body>>>>>>>>', body); console.log('body>>>>>>>>', body);
console.log('query>>>>>>>>', query); console.log('query>>>>>>>>', query);
return { return {

28286
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,58 +15,58 @@
}, },
"dependencies": { "dependencies": {
"@nutui/icons-vue": "^0.1.1", "@nutui/icons-vue": "^0.1.1",
"@nutui/nutui": "^4.1.0", "@nutui/nutui": "^4.3.13",
"@varlet/ui": "^2.13.0", "@varlet/ui": "^3.8.7",
"@vueuse/core": "10.2.1", "@vueuse/core": "12.7.0",
"@vueuse/integrations": "10.2.1", "@vueuse/integrations": "12.7.0",
"axios": "1.4.0", "axios": "1.7.9",
"dayjs": "^1.11.9", "dayjs": "^1.11.13",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"pinia": "^2.1.3", "pinia": "^3.0.1",
"pinia-plugin-persistedstate": "^3.1.0", "pinia-plugin-persistedstate": "^4.2.0",
"quarkd": "^1.0.70", "quarkd": "^2.0.5",
"universal-cookie": "^4.0.4", "universal-cookie": "^7.2.2",
"vant": "^4.6.2", "vant": "^4.9.17",
"vue": "^3.3.1", "vue": "^3.5.13",
"vue-i18n": "^9.2.2", "vue-i18n": "^11.1.1",
"vue-router": "^4.2.4" "vue-router": "^4.5.0"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.6.6", "@commitlint/cli": "^19.7.1",
"@commitlint/config-conventional": "^17.6.6", "@commitlint/config-conventional": "^19.7.1",
"@vitejs/plugin-basic-ssl": "^1.0.1", "@vitejs/plugin-basic-ssl": "^1.2.0",
"@vitejs/plugin-legacy": "^4.1.0", "@vitejs/plugin-legacy": "^6.0.1",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^3.0.1", "@vitejs/plugin-vue-jsx": "^4.1.1",
"@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^11.0.3", "@vue/eslint-config-typescript": "^14.4.0",
"@vue/test-utils": "^2.4.0", "@vue/test-utils": "^2.4.0",
"@vue/tsconfig": "^0.4.0", "@vue/tsconfig": "^0.7.0",
"amfe-flexible": "^2.2.1", "amfe-flexible": "^2.2.1",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.20",
"cnjm-postcss-px-to-viewport": "^1.0.0", "cnjm-postcss-px-to-viewport": "^1.0.1",
"consola": "^3.2.3", "consola": "^3.2.3",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cz-git": "^1.7.0", "cz-git": "^1.11.0",
"czg": "^1.7.0", "czg": "^1.11.0",
"eruda": "^3.0.0", "eruda": "^3.4.1",
"eslint": "^8.45.0", "eslint": "^9.20.1",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^10.0.1",
"eslint-define-config": "^1.21.0", "eslint-define-config": "^2.1.0",
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-vue": "^9.15.1", "eslint-plugin-vue": "^9.32.0",
"git-cz": "^4.9.0", "git-cz": "^4.9.0",
"husky": "8.0.3", "husky": "9.1.7",
"jsdom": "^22.1.0", "jsdom": "^22.1.0",
"lint-staged": "13.2.3", "lint-staged": "15.4.3",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"postcss": "^8.4.26", "postcss": "^8.5.2",
"postcss-html": "1.5.0", "postcss-html": "1.8.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^3.0.0", "prettier": "^3.5.1",
"rollup-plugin-visualizer": "^5.9.1", "rollup-plugin-visualizer": "^5.9.1",
"stylelint": "^15.10.1", "stylelint": "^15.10.1",
"stylelint-config-property-sort-order-smacss": "^9.1.0", "stylelint-config-property-sort-order-smacss": "^9.1.0",
@ -77,22 +77,26 @@
"stylelint-order": "^6.0.3", "stylelint-order": "^6.0.3",
"stylelint-prettier": "^4.0.0", "stylelint-prettier": "^4.0.0",
"terser": "^5.19.0", "terser": "^5.19.0",
"typescript": "^5.1.6", "typescript": "^5.7.3",
"unplugin-auto-import": "^0.16.6", "unplugin-auto-import": "^19.1.0",
"unplugin-vue-components": "^0.25.1", "unplugin-vue-components": "^28.2.0",
"vite": "^4.4.4", "vite": "^6.1.0",
"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",
"vite-plugin-mock": "^3.0.0", "vite-plugin-mock": "^3.0.2",
"vite-plugin-pages": "^0.31.0", "vite-plugin-pages": "^0.32.4",
"vite-plugin-progress": "^0.0.7", "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-svg-icons": "^2.0.1",
"vite-plugin-vue-setup-extend-plus": "^0.1.0", "vite-plugin-vue-setup-extend-plus": "^0.1.0",
"vitest": "^0.33.0", "vitest": "^3.0.5",
"vue-eslint-parser": "^9.3.1", "vue-eslint-parser": "^9.4.3",
"vue-tsc": "^1.8.5" "vue-tsc": "^2.2.2"
},
"engines": {
"node": ">=20.10.0",
"pnpm": ">=9.12.0"
}, },
"husky": { "husky": {
"hooks": { "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>; info: Record<any, any>;
} }
export const useUserStore = defineStore({ export const useUserStore = defineStore('user', {
id: 'app-user',
state: (): StoreUser => ({ state: (): StoreUser => ({
token: token, token: token,
info: {}, info: {},
@ -23,20 +22,22 @@ export const useUserStore = defineStore({
}, },
actions: { actions: {
setInfo(info: any) { setInfo(info: any) {
this.info = info ? info : ''; this.info = info ?? '';
}, },
login() { async login() {
return new Promise((resolve) => { try {
loginPassword().then((res) => { const res = await loginPassword(); // 调用登录接口
this.setInfo(res); this.setInfo(res); // 设置用户信息
resolve(res); this.token = res.token; // 假设返回的 res 包含 token
}); return res;
}); } catch (error) {
console.error('Login failed', error);
throw error;
}
}, },
}, },
persist: { persist: {
key: 'token', pick: ['token'],
storage: localStorage, storage: localStorage,
paths: ['token'],
}, },
}); });

View File

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

View File

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

View File

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

View File

@ -2,11 +2,11 @@
<div class="login"> <div class="login">
<h2>登录</h2> <h2>登录</h2>
<nut-form ref="ruleForm" :model-value="formData"> <nut-form ref="ruleForm" :model-value="formData">
<nut-form-item required prop="name" :rules="[{ required: true, message: '请输入用户名' }]"> <nut-form-item label="用户名" required prop="name" :rules="[{ required: true, message: '请输入用户名' }]">
<input v-model="formData.name" class="nut-input-text" placeholder="请输入用户名" type="text" /> <nut-input v-model="formData.name" placeholder="请输入用户名" type="text" />
</nut-form-item> </nut-form-item>
<nut-form-item required prop="pwd" :rules="[{ required: true, message: '请填写联系电话' }]"> <nut-form-item label="密码" required prop="pwd" :rules="[{ required: true, message: '请输入密码' }]">
<input v-model="formData.pwd" class="nut-input-text" placeholder="请输入密码" type="password" /> <nut-input v-model="formData.pwd" placeholder="请输入密码" type="password" />
</nut-form-item> </nut-form-item>
<nut-button block type="info" @click="submit"> 登录 </nut-button> <nut-button block type="info" @click="submit"> 登录 </nut-button>
</nut-form> </nut-form>
@ -28,6 +28,7 @@
ruleForm.value.validate().then(async ({ valid, errors }: any) => { ruleForm.value.validate().then(async ({ valid, errors }: any) => {
if (valid) { if (valid) {
const userInfo = await userStore.login(); const userInfo = await userStore.login();
console.log(userInfo);
if (userInfo) { if (userInfo) {
router.push({ path: '/home' }); 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" /> <img src="https://img12.360buyimg.com/imagetools/jfs/t1/143702/31/16654/116794/5fc6f541Edebf8a57/4138097748889987.png" />
</nut-avatar> </nut-avatar>
<div class="member-detail"> <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> <p class="info"> 个人其他信息后续补充.... </p>
</div> </div>
</div> </div>
@ -14,16 +17,16 @@
</template> </template>
<script lang="ts" setup name="MemberPage"> <script lang="ts" setup name="MemberPage">
// import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { Dongdong } from '@nutui/icons-vue'; import { Dongdong } from '@nutui/icons-vue';
const router = useRouter(); const router = useRouter();
// const userStore = useUserStore(); const userStore = useUserStore();
// const getUserInfo = computed(() => { const getUserInfo = computed(() => {
// const { name = '' } = userStore.getUserInfo || {}; const { name = '' } = userStore.getUserInfo || {};
// return name; return name;
// }); });
const goLogin = () => { const goLogin = () => {
router.push('/login'); router.push('/login');
}; };
@ -32,20 +35,24 @@
<style lang="scss"> <style lang="scss">
.avatar-wrap { .avatar-wrap {
display: flex; display: flex;
margin: 10px 40px;
align-items: center; align-items: center;
margin: 10px 40px;
.member-detail { .member-detail {
margin-left: 20px; margin-left: 20px;
.nickname { .nickname {
font-size: 16px; font-size: 32px;
font-weight: bold; font-weight: bold;
.nut-button { .nut-button {
margin-left: 10px; margin-left: 10px;
} }
} }
.info { .info {
margin-top: 10px; margin-top: 10px;
font-size: 16px; font-size: 24px;
} }
} }
} }

View File

@ -3,80 +3,101 @@
// @ts-nocheck // @ts-nocheck
// noinspection JSUnusedGlobalSymbols // noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import // Generated by unplugin-auto-import
// biome-ignore lint: disable
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue')['EffectScope']; const EffectScope: (typeof import('vue'))['EffectScope'];
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']; const acceptHMRUpdate: (typeof import('pinia'))['acceptHMRUpdate'];
const computed: typeof import('vue')['computed']; const computed: (typeof import('vue'))['computed'];
const createApp: typeof import('vue')['createApp']; const createApp: (typeof import('vue'))['createApp'];
const createPinia: typeof import('pinia')['createPinia']; const createPinia: (typeof import('pinia'))['createPinia'];
const customRef: typeof import('vue')['customRef']; const customRef: (typeof import('vue'))['customRef'];
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']; const defineAsyncComponent: (typeof import('vue'))['defineAsyncComponent'];
const defineComponent: typeof import('vue')['defineComponent']; const defineComponent: (typeof import('vue'))['defineComponent'];
const defineStore: typeof import('pinia')['defineStore']; const defineStore: (typeof import('pinia'))['defineStore'];
const effectScope: typeof import('vue')['effectScope']; const effectScope: (typeof import('vue'))['effectScope'];
const getActivePinia: typeof import('pinia')['getActivePinia']; const getActivePinia: (typeof import('pinia'))['getActivePinia'];
const getCurrentInstance: typeof import('vue')['getCurrentInstance']; const getCurrentInstance: (typeof import('vue'))['getCurrentInstance'];
const getCurrentScope: typeof import('vue')['getCurrentScope']; const getCurrentScope: (typeof import('vue'))['getCurrentScope'];
const h: typeof import('vue')['h']; const h: (typeof import('vue'))['h'];
const inject: typeof import('vue')['inject']; const inject: (typeof import('vue'))['inject'];
const isProxy: typeof import('vue')['isProxy']; const isProxy: (typeof import('vue'))['isProxy'];
const isReactive: typeof import('vue')['isReactive']; const isReactive: (typeof import('vue'))['isReactive'];
const isReadonly: typeof import('vue')['isReadonly']; const isReadonly: (typeof import('vue'))['isReadonly'];
const isRef: typeof import('vue')['isRef']; const isRef: (typeof import('vue'))['isRef'];
const mapActions: typeof import('pinia')['mapActions']; const mapActions: (typeof import('pinia'))['mapActions'];
const mapGetters: typeof import('pinia')['mapGetters']; const mapGetters: (typeof import('pinia'))['mapGetters'];
const mapState: typeof import('pinia')['mapState']; const mapState: (typeof import('pinia'))['mapState'];
const mapStores: typeof import('pinia')['mapStores']; const mapStores: (typeof import('pinia'))['mapStores'];
const mapWritableState: typeof import('pinia')['mapWritableState']; const mapWritableState: (typeof import('pinia'))['mapWritableState'];
const markRaw: typeof import('vue')['markRaw']; const markRaw: (typeof import('vue'))['markRaw'];
const nextTick: typeof import('vue')['nextTick']; const nextTick: (typeof import('vue'))['nextTick'];
const onActivated: typeof import('vue')['onActivated']; const onActivated: (typeof import('vue'))['onActivated'];
const onBeforeMount: typeof import('vue')['onBeforeMount']; const onBeforeMount: (typeof import('vue'))['onBeforeMount'];
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']; const onBeforeRouteLeave: (typeof import('vue-router'))['onBeforeRouteLeave'];
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']; const onBeforeRouteUpdate: (typeof import('vue-router'))['onBeforeRouteUpdate'];
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']; const onBeforeUnmount: (typeof import('vue'))['onBeforeUnmount'];
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']; const onBeforeUpdate: (typeof import('vue'))['onBeforeUpdate'];
const onDeactivated: typeof import('vue')['onDeactivated']; const onDeactivated: (typeof import('vue'))['onDeactivated'];
const onErrorCaptured: typeof import('vue')['onErrorCaptured']; const onErrorCaptured: (typeof import('vue'))['onErrorCaptured'];
const onMounted: typeof import('vue')['onMounted']; const onMounted: (typeof import('vue'))['onMounted'];
const onRenderTracked: typeof import('vue')['onRenderTracked']; const onRenderTracked: (typeof import('vue'))['onRenderTracked'];
const onRenderTriggered: typeof import('vue')['onRenderTriggered']; const onRenderTriggered: (typeof import('vue'))['onRenderTriggered'];
const onScopeDispose: typeof import('vue')['onScopeDispose']; const onScopeDispose: (typeof import('vue'))['onScopeDispose'];
const onServerPrefetch: typeof import('vue')['onServerPrefetch']; const onServerPrefetch: (typeof import('vue'))['onServerPrefetch'];
const onUnmounted: typeof import('vue')['onUnmounted']; const onUnmounted: (typeof import('vue'))['onUnmounted'];
const onUpdated: typeof import('vue')['onUpdated']; const onUpdated: (typeof import('vue'))['onUpdated'];
const provide: typeof import('vue')['provide']; const onWatcherCleanup: (typeof import('vue'))['onWatcherCleanup'];
const reactive: typeof import('vue')['reactive']; const provide: (typeof import('vue'))['provide'];
const readonly: typeof import('vue')['readonly']; const reactive: (typeof import('vue'))['reactive'];
const ref: typeof import('vue')['ref']; const readonly: (typeof import('vue'))['readonly'];
const resolveComponent: typeof import('vue')['resolveComponent']; const ref: (typeof import('vue'))['ref'];
const setActivePinia: typeof import('pinia')['setActivePinia']; const resolveComponent: (typeof import('vue'))['resolveComponent'];
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']; const setActivePinia: (typeof import('pinia'))['setActivePinia'];
const shallowReactive: typeof import('vue')['shallowReactive']; const setMapStoreSuffix: (typeof import('pinia'))['setMapStoreSuffix'];
const shallowReadonly: typeof import('vue')['shallowReadonly']; const shallowReactive: (typeof import('vue'))['shallowReactive'];
const shallowRef: typeof import('vue')['shallowRef']; const shallowReadonly: (typeof import('vue'))['shallowReadonly'];
const storeToRefs: typeof import('pinia')['storeToRefs']; const shallowRef: (typeof import('vue'))['shallowRef'];
const toRaw: typeof import('vue')['toRaw']; const storeToRefs: (typeof import('pinia'))['storeToRefs'];
const toRef: typeof import('vue')['toRef']; const toRaw: (typeof import('vue'))['toRaw'];
const toRefs: typeof import('vue')['toRefs']; const toRef: (typeof import('vue'))['toRef'];
const toValue: typeof import('vue')['toValue']; const toRefs: (typeof import('vue'))['toRefs'];
const triggerRef: typeof import('vue')['triggerRef']; const toValue: (typeof import('vue'))['toValue'];
const unref: typeof import('vue')['unref']; const triggerRef: (typeof import('vue'))['triggerRef'];
const useAttrs: typeof import('vue')['useAttrs']; const unref: (typeof import('vue'))['unref'];
const useCssModule: typeof import('vue')['useCssModule']; const useAttrs: (typeof import('vue'))['useAttrs'];
const useCssVars: typeof import('vue')['useCssVars']; const useCssModule: (typeof import('vue'))['useCssModule'];
const useLink: typeof import('vue-router')['useLink']; const useCssVars: (typeof import('vue'))['useCssVars'];
const useRoute: typeof import('vue-router')['useRoute']; const useId: (typeof import('vue'))['useId'];
const useRouter: typeof import('vue-router')['useRouter']; const useLink: (typeof import('vue-router'))['useLink'];
const useSlots: typeof import('vue')['useSlots']; const useModel: (typeof import('vue'))['useModel'];
const watch: typeof import('vue')['watch']; const useRoute: (typeof import('vue-router'))['useRoute'];
const watchEffect: typeof import('vue')['watchEffect']; const useRouter: (typeof import('vue-router'))['useRouter'];
const watchPostEffect: typeof import('vue')['watchPostEffect']; const useSlots: (typeof import('vue'))['useSlots'];
const watchSyncEffect: typeof import('vue')['watchSyncEffect']; 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 // for type re-export
declare global { declare global {
// @ts-ignore // @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 */ /* eslint-disable */
/* prettier-ignore */
// @ts-nocheck // @ts-nocheck
// Generated by unplugin-vue-components // Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
export {} export {};
/* prettier-ignore */
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
BasicModal: typeof import('./../src/components/Modal/src/BasicModal.vue')['default']; BasicModal: typeof import('./../src/components/Modal/src/BasicModal.vue')['default']
NutAvatar: typeof import('@nutui/nutui')['Avatar']; NutAvatar: typeof import('@nutui/nutui')['Avatar']
NutButton: typeof import('@nutui/nutui')['Button']; NutButton: typeof import('@nutui/nutui')['Button']
NutCard: typeof import('@nutui/nutui')['Card']; NutCard: typeof import('@nutui/nutui')['Card']
NutCell: typeof import('@nutui/nutui')['Cell']; NutCell: typeof import('@nutui/nutui')['Cell']
NutCellGroup: typeof import('@nutui/nutui')['CellGroup']; NutCellGroup: typeof import('@nutui/nutui')['CellGroup']
NutForm: typeof import('@nutui/nutui')['Form']; NutForm: typeof import('@nutui/nutui')['Form']
NutFormItem: typeof import('@nutui/nutui')['FormItem']; NutFormItem: typeof import('@nutui/nutui')['FormItem']
NutGrid: typeof import('@nutui/nutui')['Grid']; NutGrid: typeof import('@nutui/nutui')['Grid']
NutGridItem: typeof import('@nutui/nutui')['GridItem']; NutGridItem: typeof import('@nutui/nutui')['GridItem']
NutSwiper: typeof import('@nutui/nutui')['Swiper']; NutInput: typeof import('@nutui/nutui')['Input']
NutSwiperItem: typeof import('@nutui/nutui')['SwiperItem']; NutSwiper: typeof import('@nutui/nutui')['Swiper']
NutTabbar: typeof import('@nutui/nutui')['Tabbar']; NutSwiperItem: typeof import('@nutui/nutui')['SwiperItem']
NutTabbarItem: typeof import('@nutui/nutui')['TabbarItem']; NutTabbar: typeof import('@nutui/nutui')['Tabbar']
RouterLink: typeof import('vue-router')['RouterLink']; NutTabbarItem: typeof import('@nutui/nutui')['TabbarItem']
RouterView: typeof import('vue-router')['RouterView']; RouterLink: typeof import('vue-router')['RouterLink']
VanButton: typeof import('vant/es')['Button']; RouterView: typeof import('vue-router')['RouterView']
VanNavBar: typeof import('vant/es')['NavBar']; VanButton: typeof import('vant/es')['Button']
VarButton: typeof import('@varlet/ui')['_ButtonComponent']; VanNavBar: typeof import('vant/es')['NavBar']
VarSpace: typeof import('@varlet/ui')['_SpaceComponent']; 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_ERUDA: Boolean;
VITE_USE_COMPRESS: Boolean; VITE_USE_COMPRESS: Boolean;
VITE_USE_REPORT: Boolean; VITE_USE_REPORT: Boolean;
VITE_USE_HTTPS: Boolean;
} }
declare function parseInt(s: string | number, radix?: number): number; declare function parseInt(s: string | number, radix?: number): number;

View File

@ -38,7 +38,6 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
server: { server: {
host: true, host: true,
hmr: true, hmr: true,
https: true,
}, },
plugins: createVitePlugins(viteEnv, isProduction), plugins: createVitePlugins(viteEnv, isProduction),
build: { build: {
@ -55,7 +54,7 @@ export default function ({ command, mode }: ConfigEnv): UserConfig {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
// 配置 nutui 全局 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