mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-13 17:30:27 +08:00
fix: 修复标签页操作示例在切换国际化时报错
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
getNodeByUniqueId,
|
||||
appendFieldByUniqueId
|
||||
} from "@/utils/tree";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useDetail } from "./hooks";
|
||||
import { ref, computed } from "vue";
|
||||
import { clone } from "@pureadmin/utils";
|
||||
@@ -15,6 +16,7 @@ defineOptions({
|
||||
name: "Tabs"
|
||||
});
|
||||
|
||||
const { locale } = useI18n();
|
||||
const { toDetail, router } = useDetail();
|
||||
const menusTree = clone(usePermissionStoreHook().wholeMenus, true);
|
||||
|
||||
@@ -30,6 +32,12 @@ const multiTags = computed(() => {
|
||||
return useMultiTagsStoreHook()?.multiTags;
|
||||
});
|
||||
|
||||
const treeSelectProps = {
|
||||
label: (data: any) => transformI18n(data.meta.title),
|
||||
children: "children",
|
||||
disabled: "disabled"
|
||||
};
|
||||
|
||||
function onCloseTags() {
|
||||
if (currentValues.value.length === 0) return;
|
||||
currentValues.value.forEach(uniqueId => {
|
||||
@@ -92,6 +100,7 @@ function onCloseTags() {
|
||||
|
||||
<el-divider />
|
||||
<el-tree-select
|
||||
:key="locale"
|
||||
v-model="currentValues"
|
||||
class="w-[300px]!"
|
||||
node-key="uniqueId"
|
||||
@@ -100,11 +109,7 @@ function onCloseTags() {
|
||||
multiple
|
||||
filterable
|
||||
default-expand-all
|
||||
:props="{
|
||||
label: data => transformI18n(data.meta.title),
|
||||
children: 'children',
|
||||
disabled: 'disabled'
|
||||
}"
|
||||
:props="treeSelectProps"
|
||||
:data="treeData"
|
||||
>
|
||||
<template #default="{ data }">
|
||||
|
||||
Reference in New Issue
Block a user