mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 00:18:26 +08:00
feat: upgrade to vue 3.4 and fix route issues (#699)
* feat: 升级Vue3.4,修复Route调用方式造成一系列问题 * fix: 修复编译问题
This commit is contained in:
parent
0f7096a167
commit
13505fdedc
|
@ -32,11 +32,11 @@
|
||||||
"qrcode.vue": "^3.4.1",
|
"qrcode.vue": "^3.4.1",
|
||||||
"qs": "^6.11.2",
|
"qs": "^6.11.2",
|
||||||
"tdesign-icons-vue-next": "^0.2.2",
|
"tdesign-icons-vue-next": "^0.2.2",
|
||||||
"tdesign-vue-next": "^1.8.1",
|
"tdesign-vue-next": "^1.9.3",
|
||||||
"tvision-color": "^1.6.0",
|
"tvision-color": "^1.6.0",
|
||||||
"vue": "~3.3.8",
|
"vue": "~3.4.21",
|
||||||
"vue-i18n": "^9.9.1",
|
"vue-i18n": "^9.9.1",
|
||||||
"vue-router": "~4.2.5"
|
"vue-router": "~4.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^18.6.0",
|
"@commitlint/cli": "^18.6.0",
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
:header-affixed-top="headerAffixedTop"
|
:header-affixed-top="headerAffixedTop"
|
||||||
@page-change="rehandlePageChange"
|
@page-change="rehandlePageChange"
|
||||||
@change="rehandleChange"
|
@change="rehandleChange"
|
||||||
@select-change="(value) => rehandleSelectChange(value as number[])"
|
@select-change="(value: number[]) => rehandleSelectChange(value)"
|
||||||
>
|
>
|
||||||
<template #status="{ row }">
|
<template #status="{ row }">
|
||||||
<t-tag v-if="row.status === CONTRACT_STATUS.FAIL" theme="danger" variant="light">
|
<t-tag v-if="row.status === CONTRACT_STATUS.FAIL" theme="danger" variant="light">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import uniq from 'lodash/uniq';
|
import uniq from 'lodash/uniq';
|
||||||
import { createRouter, createWebHistory, RouteRecordRaw, useRoute } from 'vue-router';
|
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
|
||||||
|
|
||||||
const env = import.meta.env.MODE || 'development';
|
const env = import.meta.env.MODE || 'development';
|
||||||
|
|
||||||
|
@ -59,7 +59,8 @@ export const getRoutesExpanded = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getActive = (maxLevel = 3): string => {
|
export const getActive = (maxLevel = 3): string => {
|
||||||
const route = useRoute();
|
// 非组件内调用必须通过Router实例获取当前路由
|
||||||
|
const route = router.currentRoute.value;
|
||||||
|
|
||||||
if (!route.path) {
|
if (!route.path) {
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
|
"jsxImportSource": "vue",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user