feat(hooks): add setOptions for useEcharts
This commit is contained in:
parent
e7f0a30bd8
commit
e4d53aa7b5
@ -146,6 +146,10 @@ export function useEcharts<T extends ECOption>(optionsFactory: () => T, hooks: C
|
|||||||
await onUpdated?.(chart!);
|
await onUpdated?.(chart!);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setOptions(options: T) {
|
||||||
|
chart?.setOption(options);
|
||||||
|
}
|
||||||
|
|
||||||
/** render chart */
|
/** render chart */
|
||||||
async function render() {
|
async function render() {
|
||||||
if (!isRendered()) {
|
if (!isRendered()) {
|
||||||
@ -225,6 +229,7 @@ export function useEcharts<T extends ECOption>(optionsFactory: () => T, hooks: C
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
domRef,
|
domRef,
|
||||||
updateOptions
|
updateOptions,
|
||||||
|
setOptions
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user