Kaynağa Gözat

调换change-metric的值顺序

guojing_wu 1 yıl önce
ebeveyn
işleme
95562f1081

+ 1 - 1
src/components/MetricsCards/index.vue

@@ -64,7 +64,7 @@ const unsetColor = (color: string ) => {
     colorsMap[color] = false
   }
 }
-const changedMetric = (oldVal: string, newVal: string) => {
+const changedMetric = (newVal: string, oldVal: string) => {
   for (const info of allMetricItems.value) {
     if (info.value === newVal) {
       info.disabled = true 

+ 1 - 1
src/components/MetricsCards/mCard.vue

@@ -32,7 +32,7 @@ const emits = defineEmits(["update:modelValue", "change-metric"])
 const metric = ref(props.modelValue)
 const changeMetric = ( newVal: string, oldVal: string) => {
   emits('update:modelValue', newVal)
-  emits('change-metric', oldVal, newVal)
+  emits('change-metric', newVal, oldVal)
 }
 const selectedData = computed(():MetricData|null => {
   const info = props.metricItems.find(item => item.value === metric.value)