fix table

This commit is contained in:
Qiuxia Fan 2022-04-02 12:01:25 +08:00
parent 363745aa00
commit 7550179e4e
2 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,6 @@ import {
computed, computed,
} from "vue"; } from "vue";
import type { PropType } from "vue"; import type { PropType } from "vue";
import _ from "lodash";
import { useECharts } from "@/hooks/useEcharts"; import { useECharts } from "@/hooks/useEcharts";
import { addResizeListener, removeResizeListener } from "@/utils/event"; import { addResizeListener, removeResizeListener } from "@/utils/event";
@ -72,15 +71,15 @@ onMounted(async () => {
}); });
watch( watch(
() => _.cloneDeepWith(props.option), () => props.option,
(data, old) => { (newVal, oldVal) => {
if (!available.value) { if (!available.value) {
return; return;
} }
if (data === old) { if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
return; return;
} }
setOptions(data); setOptions(newVal);
} }
); );

View File

@ -48,6 +48,7 @@ limitations under the License. -->
getLabel(metric, index) getLabel(metric, index)
)} ${decodeURIComponent(getUnit(index))}`" )} ${decodeURIComponent(getUnit(index))}`"
:key="metric + index" :key="metric + index"
min-width="120"
> >
<template #default="scope"> <template #default="scope">
<div class="chart"> <div class="chart">
@ -70,7 +71,7 @@ limitations under the License. -->
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Attributes" :width="100"> <el-table-column label="Attributes">
<template #default="scope"> <template #default="scope">
<el-popover placement="left" :width="400" trigger="click"> <el-popover placement="left" :width="400" trigger="click">
<template #reference> <template #reference>