fix: rerender charts

This commit is contained in:
Qiuxia Fan 2022-01-12 18:58:58 +08:00
parent a5f8cc2900
commit 8435beda35
2 changed files with 12 additions and 9 deletions

View File

@ -54,7 +54,7 @@ limitations under the License. -->
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { toRefs, reactive, defineComponent, ref } from "vue"; import { toRefs, reactive, defineComponent, ref, watch } from "vue";
import type { PropType } from "vue"; import type { PropType } from "vue";
import { LayoutConfig } from "@/types/dashboard"; import { LayoutConfig } from "@/types/dashboard";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
@ -114,12 +114,15 @@ export default defineComponent({
dashboardStore.setConfigPanel(true); dashboardStore.setConfigPanel(true);
dashboardStore.selectWidget(props.data); dashboardStore.selectWidget(props.data);
} }
// watch( watch(
// () => data.value, () => [props.data.queryMetricType, props.data.metrics],
// (data) => { (data, old) => {
// console.log(data); if (data[0] === old[0] && data[1] === old[1]) {
// } return;
// ); }
queryMetrics();
}
);
return { return {
state, state,
appStoreWithOut, appStoreWithOut,

View File

@ -18,7 +18,7 @@
import Area from "./Area.vue"; import Area from "./Area.vue";
import Line from "./Line.vue"; import Line from "./Line.vue";
import Bar from "./Bar.vue"; import Bar from "./Bar.vue";
import Heatmap from "./Heatmap.vue"; // import Heatmap from "./Heatmap.vue";
import TopList from "./TopList.vue"; import TopList from "./TopList.vue";
import Table from "./Table.vue"; import Table from "./Table.vue";
import Pie from "./Pie.vue"; import Pie from "./Pie.vue";
@ -27,7 +27,7 @@ import Card from "./Card.vue";
export default { export default {
Line, Line,
Bar, Bar,
Heatmap, // Heatmap,
TopList, TopList,
Area, Area,
Table, Table,