v4.1.5一些小细节更新

This commit is contained in:
XiaoDaiGua-Ray 2023-08-06 16:48:38 +08:00
parent 660b61340d
commit be406cc026
5 changed files with 20 additions and 27 deletions

View File

@ -9,11 +9,11 @@
}, },
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "eslint src && vue-tsc --noEmit && vite build --mode production", "build": "vue-tsc --noEmit && vite build --mode production",
"preview": "vite preview", "preview": "vite preview",
"test": "eslint src && vue-tsc --noEmit && vite build --mode test", "test": "vue-tsc --noEmit && vite build --mode test",
"dev-build": "eslint src && vue-tsc --noEmit && vite build --mode development", "dev-build": "vue-tsc --noEmit && vite build --mode development",
"report": "eslint src && vue-tsc --noEmit && vite build --mode report", "report": "vue-tsc --noEmit && vite build --mode report",
"prepare": "husky install" "prepare": "husky install"
}, },
"lint-staged": { "lint-staged": {
@ -52,7 +52,6 @@
"@commitlint/cli": "^17.4.2", "@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2", "@commitlint/config-conventional": "^17.4.2",
"@intlify/unplugin-vue-i18n": "^0.12.1", "@intlify/unplugin-vue-i18n": "^0.12.1",
"@nabla/vite-plugin-eslint": "1.5.0",
"@types/crypto-js": "^4.1.1", "@types/crypto-js": "^4.1.1",
"@types/lodash-es": "^4.17.7", "@types/lodash-es": "^4.17.7",
"@types/scrollreveal": "^0.0.8", "@types/scrollreveal": "^0.0.8",
@ -91,7 +90,7 @@
"vite-plugin-imp": "^2.3.1", "vite-plugin-imp": "^2.3.1",
"vite-plugin-inspect": "^0.7.26", "vite-plugin-inspect": "^0.7.26",
"vite-plugin-svg-icons": "^2.0.1", "vite-plugin-svg-icons": "^2.0.1",
"vite-svg-loader": "^3.4.0", "vite-svg-loader": "^4.0.0",
"vue-tsc": "^1.8.4" "vue-tsc": "^1.8.4"
}, },
"description": "<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->", "description": "<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->",
@ -102,10 +101,10 @@
}, },
"keywords": [ "keywords": [
"ray-template", "ray-template",
"vue3.2模板",
"vue3-tsx-vite-pinia", "vue3-tsx-vite-pinia",
"ray template", "ray template",
"Ray Template", "vite",
"vue3",
"admin template", "admin template",
"中后台模板" "中后台模板"
], ],

View File

@ -1,23 +1,23 @@
import { RouterView } from 'vue-router' import { RouterView } from 'vue-router'
import AppNaiveGlobalProvider from '@/app-components/provider/AppNaiveGlobalProvider/index' import AppNaiveGlobalProvider from '@/app-components/provider/AppNaiveGlobalProvider/index'
import AppStyleProvider from '@/app-components/provider/AppStyleProvider/index' import AppStyleProvider from '@/app-components/provider/AppStyleProvider/index'
import GlobalSpin from '@/spin/index' import AppLockScreen from '@/app-components/app/AppLockScreen/index'
import LockScreen from '@/app-components/app/AppLockScreen/index' import AppGlobalSpin from '@/spin/index'
const App = defineComponent({ const App = defineComponent({
name: 'App', name: 'App',
render() { render() {
return ( return (
<AppNaiveGlobalProvider> <AppNaiveGlobalProvider>
<LockScreen /> <AppLockScreen />
<AppStyleProvider /> <AppStyleProvider />
<GlobalSpin> <AppGlobalSpin>
{{ {{
default: () => <RouterView />, default: () => <RouterView />,
description: () => 'lodaing...', description: () => 'lodaing...',
}} }}
</GlobalSpin> </AppGlobalSpin>
</AppNaiveGlobalProvider> </AppNaiveGlobalProvider>
) )
}, },

View File

@ -31,6 +31,7 @@ export const layoutHeaderCssVars = (
'--layout-content-height': `calc(100% - ${siderBar.height.value}px - ${menuTag.height.value}px - ${footer.height.value}px)`, '--layout-content-height': `calc(100% - ${siderBar.height.value}px - ${menuTag.height.value}px - ${footer.height.value}px)`,
'--layout-siderbar-height': `${siderBar.height.value}px`, '--layout-siderbar-height': `${siderBar.height.value}px`,
'--layout-menutag-height': `${menuTag.height.value}px`, '--layout-menutag-height': `${menuTag.height.value}px`,
'--layout-footer-height': `${footer.height.value}px`,
} }
}) })
} }

View File

@ -35,9 +35,12 @@ import type { AppRouteRecordRaw, RouteModules } from '@/router/type'
* modules ts , 使 * modules ts , 使
*/ */
export const combineRawRouteModules = () => { export const combineRawRouteModules = () => {
const modulesFiles: RouteModules = import.meta.glob('../modules/**/*.ts', { const modulesFiles: RouteModules = import.meta.glob(
eager: true, '@/router/modules/**/*.ts',
}) {
eager: true,
},
)
const modules = Object.keys(modulesFiles).reduce((modules, modulePath) => { const modules = Object.keys(modulesFiles).reduce((modules, modulePath) => {
const route = modulesFiles[modulePath].default const route = modulesFiles[modulePath].default

View File

@ -10,7 +10,6 @@ import viteVueJSX from '@vitejs/plugin-vue-jsx'
import viteVeI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import viteVeI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import viteInspect from 'vite-plugin-inspect' import viteInspect from 'vite-plugin-inspect'
import viteSvgLoader from 'vite-svg-loader' import viteSvgLoader from 'vite-svg-loader'
import viteEslintPlugin from '@nabla/vite-plugin-eslint'
import vitePluginImp from 'vite-plugin-imp' // 按需打包工具 import vitePluginImp from 'vite-plugin-imp' // 按需打包工具
import { visualizer } from 'rollup-plugin-visualizer' // 打包体积分析工具 import { visualizer } from 'rollup-plugin-visualizer' // 打包体积分析工具
import viteCompression from 'vite-plugin-compression' // 压缩打包 import viteCompression from 'vite-plugin-compression' // 压缩打包
@ -108,21 +107,12 @@ export default defineConfig(async ({ mode }) => {
defaultImport: 'component', // 默认以 `componetn` 形式导入 `svg` defaultImport: 'component', // 默认以 `componetn` 形式导入 `svg`
}), }),
viteSVGIcon(), viteSVGIcon(),
// viteEslintPlugin({
// formatter: 'stylish',
// eslintOptions: {
// cache: true,
// fix: true,
// extensions: ['.vue', '.tsx', '.ts', '.js', '.jsx'],
// },
// }),
viteEslint({ viteEslint({
lintOnStart: true, lintOnStart: true,
failOnError: true, failOnError: true,
failOnWarning: true, failOnWarning: true,
cache: true,
fix: true, fix: true,
exclude: ['dist/**', '**/node_modules/**'], exclude: ['dist/**', '**/node_modules/**', 'vite-env.d.ts', '*.md'],
include: ['src/**/*.{vue,js,jsx,ts,tsx}'], include: ['src/**/*.{vue,js,jsx,ts,tsx}'],
}), }),
vitePluginImp({ vitePluginImp({