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