소스 검색

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>