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 */
|
||||
import {
|
||||
install,
|
||||
defineComponent,
|
||||
ref,
|
||||
unref,
|
||||
@ -39,8 +38,6 @@ import {
|
||||
import "./style.css";
|
||||
import { omitOn } from "./utils";
|
||||
|
||||
install();
|
||||
|
||||
const TAG_NAME = "x-vue-echarts";
|
||||
|
||||
if (Vue2) {
|
||||
@ -145,10 +142,14 @@ export default defineComponent({
|
||||
|
||||
instance.setOption(option || realOption.value, realUpdateOptions.value);
|
||||
|
||||
// Make sure the chart fits the container in next UI render (after current task)
|
||||
setTimeout(() => {
|
||||
function resize() {
|
||||
if (instance && !instance.isDisposed()) {
|
||||
instance.resize();
|
||||
});
|
||||
}
|
||||
}
|
||||
// Make sure the chart fits the container in next UI render (after current task)
|
||||
nextTick(resize);
|
||||
setTimeout(resize);
|
||||
}
|
||||
|
||||
function setOption(option: Option, updateOptions?: UpdateOptions) {
|
||||
|
||||
Reference in New Issue
Block a user