refactor: use toRef instead of watching a function, mute rollup for mixed use of default/named export

This commit is contained in:
Justineo
2021-02-23 19:02:45 +08:00
parent c1bf3695cc
commit 175d823200
2 changed files with 5 additions and 2 deletions

View File

@ -31,11 +31,13 @@ const options = [
{
file: "dist/index.cjs.js",
format: "cjs",
exports: "named",
sourcemap: true
},
{
file: "dist/index.cjs.min.js",
format: "cjs",
exports: "named",
sourcemap: true,
plugins: [
terser({

View File

@ -79,8 +79,9 @@ export default defineComponent({
);
const { autoresize, manualUpdate, loading } = toRefs(props);
const theme = toRef(props, "theme");
const initOptions = toRef(props, "initOptions");
const loadingOptions = toRef(props, "loadingOptions");
const a = toRef(props, "autoresize");
function init(option?: Option) {
if (chart.value || !root.value) {
@ -170,7 +171,7 @@ export default defineComponent({
);
watch(
[() => props.theme, () => props.initOptions],
[theme, initOptions],
() => {
cleanup();
init();