浏览代码

fix: 修改组件不会一起变更的问题

MTrun 3 年之前
父节点
当前提交
1b7ee5cb2e
共有 1 个文件被更改,包括 16 次插入2 次删除
  1. 16 2
      src/components/ChartItemSetting/GlobalSetting.vue

+ 16 - 2
src/components/ChartItemSetting/GlobalSetting.vue

@@ -236,7 +236,7 @@
 </template>
 
 <script setup lang="ts">
-import { toRefs, PropType } from 'vue'
+import { toRefs, PropType, watchEffect, computed } from 'vue'
 import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
 import { axisConf } from '@/packages/chartConfiguration/echarts/index'
 import {
@@ -257,7 +257,21 @@ const props = defineProps({
   }
 })
 
-const { title, xAxis, yAxis, legend } = toRefs(props.data)
+const title = computed(() => {
+  return props.data.title
+})
+
+const xAxis = computed(() => {
+  return props.data.xAxis
+})
+
+const yAxis = computed(() => {
+  return props.data.yAxis
+})
+
+const legend = computed(() => {
+  return props.data.legend
+})
 </script>
 
 <style lang="scss" scoped>