mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-16 12:52:48 +08:00
refactor: use toRef instead of watching a function, mute rollup for mixed use of default/named export
This commit is contained in:
@ -31,11 +31,13 @@ const options = [
|
|||||||
{
|
{
|
||||||
file: "dist/index.cjs.js",
|
file: "dist/index.cjs.js",
|
||||||
format: "cjs",
|
format: "cjs",
|
||||||
|
exports: "named",
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
file: "dist/index.cjs.min.js",
|
file: "dist/index.cjs.min.js",
|
||||||
format: "cjs",
|
format: "cjs",
|
||||||
|
exports: "named",
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
terser({
|
terser({
|
||||||
|
@ -79,8 +79,9 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const { autoresize, manualUpdate, loading } = toRefs(props);
|
const { autoresize, manualUpdate, loading } = toRefs(props);
|
||||||
|
const theme = toRef(props, "theme");
|
||||||
|
const initOptions = toRef(props, "initOptions");
|
||||||
const loadingOptions = toRef(props, "loadingOptions");
|
const loadingOptions = toRef(props, "loadingOptions");
|
||||||
const a = toRef(props, "autoresize");
|
|
||||||
|
|
||||||
function init(option?: Option) {
|
function init(option?: Option) {
|
||||||
if (chart.value || !root.value) {
|
if (chart.value || !root.value) {
|
||||||
@ -170,7 +171,7 @@ export default defineComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[() => props.theme, () => props.initOptions],
|
[theme, initOptions],
|
||||||
() => {
|
() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
init();
|
init();
|
||||||
|
Reference in New Issue
Block a user