mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-28 23:48:21 +08:00
fix: remove unnecessary install, ensure initial resize
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import {
|
import {
|
||||||
install,
|
|
||||||
defineComponent,
|
defineComponent,
|
||||||
ref,
|
ref,
|
||||||
unref,
|
unref,
|
||||||
@ -39,8 +38,6 @@ import {
|
|||||||
import "./style.css";
|
import "./style.css";
|
||||||
import { omitOn } from "./utils";
|
import { omitOn } from "./utils";
|
||||||
|
|
||||||
install();
|
|
||||||
|
|
||||||
const TAG_NAME = "x-vue-echarts";
|
const TAG_NAME = "x-vue-echarts";
|
||||||
|
|
||||||
if (Vue2) {
|
if (Vue2) {
|
||||||
@ -145,10 +142,14 @@ export default defineComponent({
|
|||||||
|
|
||||||
instance.setOption(option || realOption.value, realUpdateOptions.value);
|
instance.setOption(option || realOption.value, realUpdateOptions.value);
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
if (instance && !instance.isDisposed()) {
|
||||||
|
instance.resize();
|
||||||
|
}
|
||||||
|
}
|
||||||
// Make sure the chart fits the container in next UI render (after current task)
|
// Make sure the chart fits the container in next UI render (after current task)
|
||||||
setTimeout(() => {
|
nextTick(resize);
|
||||||
instance.resize();
|
setTimeout(resize);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setOption(option: Option, updateOptions?: UpdateOptions) {
|
function setOption(option: Option, updateOptions?: UpdateOptions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user