fix: 修复直接通过浏览器地址栏打开演示环境标签详情页,tag未加载的情况

This commit is contained in:
xiaoxian521
2022-05-17 00:52:07 +08:00
parent f4c419d44a
commit 9ca764b2a6
3 changed files with 39 additions and 27 deletions

View File

@@ -1,16 +1,16 @@
<script setup lang="ts">
import { ref, computed } from "vue";
import { transformI18n } from "/@/plugins/i18n";
import { useRouter, useRoute } from "vue-router";
import { TreeSelect } from "@pureadmin/components";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import {
deleteChildren,
appendFieldByUniqueId,
getNodeByUniqueId
} from "/@/utils/tree";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { useDetail } from "./hooks";
const { toDetail } = useDetail();
let treeData = computed(() => {
return appendFieldByUniqueId(
@@ -20,26 +20,8 @@ let treeData = computed(() => {
);
});
const route = useRoute();
const router = useRouter();
const value = ref<string[]>([]);
function toDetail(index: number) {
useMultiTagsStoreHook().handleTags("push", {
path: `/tabs/detail`,
parentPath: route.matched[0].path,
name: "tabDetail",
query: { id: String(index) },
meta: {
title: { zh: `No.${index} - 详情信息`, en: `No.${index} - DetailInfo` },
showLink: false,
dynamicLevel: 3
}
});
router.push({ name: "tabDetail", query: { id: String(index) } });
}
function onCloseTags() {
value.value.forEach(uniqueId => {
let currentPath =