From 5d88cbc5c84146c53fb6f8995aa2a3790104d6e6 Mon Sep 17 00:00:00 2001
From: wangshuaiswim
Date: Tue, 31 Jan 2023 11:36:21 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=A9=E6=A8=A1?=
=?UTF-8?q?=E5=9E=8BCat=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../device/components/Metadata/Cat/index.vue | 43 +++++++++++--------
1 file changed, 24 insertions(+), 19 deletions(-)
diff --git a/src/views/device/components/Metadata/Cat/index.vue b/src/views/device/components/Metadata/Cat/index.vue
index 5936eb0d..e0292159 100644
--- a/src/views/device/components/Metadata/Cat/index.vue
+++ b/src/views/device/components/Metadata/Cat/index.vue
@@ -16,9 +16,10 @@
-
+
+ {{ value }}
@@ -120,25 +121,29 @@ watch(
{ immediate: true }
)
-watchEffect(() => {
- if (props.visible) {
- loading.value = true
- const { id } = route.params
- if (props.type === 'device') {
- detail(id as string).then((resp) => {
- loading.value = false
- instanceStore.setCurrent(resp.result)
- value.value = resp.result.metadata
- });
- } else {
- productDetail(id as string).then((resp) => {
- loading.value = false
- // productStore.setCurrent(resp.result)
- value.value = resp.result.metadata
- });
+watch(
+ [props.visible, props.type],
+ () => {
+ if (props.visible) {
+ loading.value = true
+ const { id } = route.params
+ if (props.type === 'device') {
+ detail(id as string).then((resp) => {
+ loading.value = false
+ instanceStore.setCurrent(resp.result)
+ value.value = resp.result.metadata
+ });
+ } else {
+ productDetail(id as string).then((resp) => {
+ loading.value = false
+ // productStore.setCurrent(resp.result)
+ value.value = resp.result.metadata
+ });
+ }
}
- }
-})
+ },
+ { immediate: true }
+)