perf: 优化部分代码

This commit is contained in:
h_mo 2023-03-31 16:16:36 +08:00
parent c064617c16
commit 421ec1cb3d
6 changed files with 16 additions and 14 deletions

2
.env
View File

@ -1,2 +1,2 @@
# title # title
VITE_APP_TITLE = uni-app Vue3 TypeScript VITE_APP_TITLE = Uni-app Vue3 Ts --Vite

View File

@ -54,7 +54,7 @@
"@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-quickapp-webview": "3.0.0-alpha-3071220230324001",
"@fortawesome/fontawesome-free": "^6.4.0", "@fortawesome/fontawesome-free": "^6.4.0",
"@iconify/iconify": "^3.1.0", "@iconify/iconify": "^3.1.0",
"alova": "^2.0.9", "alova": "^2.0.11",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"echarts": "^5.4.2", "echarts": "^5.4.2",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
@ -63,14 +63,14 @@
"vue": "^3.2.47" "vue": "^3.2.47"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.5.0", "@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4", "@commitlint/config-conventional": "^17.4.4",
"@dcloudio/types": "^3.2.11", "@dcloudio/types": "^3.2.11",
"@dcloudio/uni-automator": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-automator": "3.0.0-alpha-3071220230324001",
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3071220230324001",
"@dcloudio/uni-stacktracey": "3.0.0-alpha-3071220230324001", "@dcloudio/uni-stacktracey": "3.0.0-alpha-3071220230324001",
"@dcloudio/vite-plugin-uni": "3.0.0-alpha-3071220230324001", "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3071220230324001",
"@iconify/json": "^2.2.40", "@iconify/json": "^2.2.42",
"@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/node": "^17.0.45", "@types/node": "^17.0.45",
@ -79,14 +79,14 @@
"@typescript-eslint/parser": "^5.57.0", "@typescript-eslint/parser": "^5.57.0",
"@unocss/preset-icons": "^0.46.5", "@unocss/preset-icons": "^0.46.5",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"eslint": "^8.36.0", "eslint": "^8.37.0",
"eslint-plugin-vue": "^9.10.0", "eslint-plugin-vue": "^9.10.0",
"husky": "^8.0.3", "husky": "^8.0.3",
"lint-staged": "^13.2.0", "lint-staged": "^13.2.0",
"postcss": "^8.4.21", "postcss": "^8.4.21",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"sass": "^1.60.0", "sass": "^1.60.0",
"typescript": "^5.0.2", "typescript": "^5.0.3",
"unocss": "^0.46.5", "unocss": "^0.46.5",
"unocss-preset-weapp": "^0.2.5", "unocss-preset-weapp": "^0.2.5",
"vite": "^4.2.1" "vite": "^4.2.1"

View File

@ -1,6 +1,6 @@
<script lang="ts" setup name="AppProvider"></script> <script lang="ts" setup name="AppProvider"></script>
<template> <template>
<view class="_u_bg-blue-500"> <view>
<slot></slot> <slot></slot>
</view> </view>
</template> </template>

View File

@ -3,8 +3,7 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "Home"
"navigationStyle": "custom"
}, },
"meta": { "meta": {
"ignoreAuth": true "ignoreAuth": true
@ -96,8 +95,8 @@
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#262833", "navigationBarBackgroundColor": "#F2F2F2",
"backgroundColor": "#F8F8F8", "backgroundColor": "#F2F2F2",
"navigationStyle": "default", "navigationStyle": "default",
"renderingMode": "seperated", "renderingMode": "seperated",
"pageOrientation": "portrait" "pageOrientation": "portrait"
@ -105,7 +104,7 @@
"tabBar": { "tabBar": {
"color": "#474747", "color": "#474747",
"selectedColor": "#9BC6FC", "selectedColor": "#9BC6FC",
"backgroundColor": "#FFFFFF", "backgroundColor": "#F2F2F2",
"list": [ "list": [
{ {
"pagePath": "pages/index/index", "pagePath": "pages/index/index",

View File

@ -6,8 +6,11 @@ import { useRouter } from '@/hooks/router';
import { CURRENT_PLATFORM, PLATFORMS } from '@/enums/platformEnum'; import { CURRENT_PLATFORM, PLATFORMS } from '@/enums/platformEnum';
import { judgePlatform } from '@/utils/platform'; import { judgePlatform } from '@/utils/platform';
import Iconify from '@/components/Iconify/index.vue'; import Iconify from '@/components/Iconify/index.vue';
import { getEnvValue } from '@/utils/env';
const title = ref('uni-app vue3 ts --Vite'); const appTitle = getEnvValue<string>('VITE_APP_TITLE');
const title = ref(appTitle);
const platform = CURRENT_PLATFORM; const platform = CURRENT_PLATFORM;

View File

@ -26,7 +26,7 @@ const submit = (e: any) => {
authStore.setToken(res.token); authStore.setToken(res.token);
setTimeout(() => { setTimeout(() => {
if (redirect.value) { if (redirect.value) {
router.go(redirect.value, { replace: true }); router.go(redirect.value!, { replace: true });
return; return;
} }
router.pushTab('/pages/about/index'); router.pushTab('/pages/about/index');