From 9f942b88c03534dba93b44aa88747de1b27dd3ad Mon Sep 17 00:00:00 2001 From: Wu Yongfeng Date: Sat, 6 Jul 2024 13:31:08 +0800 Subject: [PATCH] fix cssPath reactivity issue --- src/plugin/VCodeBlock.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugin/VCodeBlock.vue b/src/plugin/VCodeBlock.vue index f407836..adcf60d 100644 --- a/src/plugin/VCodeBlock.vue +++ b/src/plugin/VCodeBlock.vue @@ -184,7 +184,7 @@ const renderedCode = ref(''); const runTextValue = ref(''); const useTheme = ref(''); -const { copyButton, copyIcons, copyTab, cssPath, label, runTab, tabs } = toRefs(settings.value); +const { copyButton, copyIcons, copyTab, label, runTab, tabs } = toRefs(settings.value); // -------------------------------------------------- Computed // @@ -297,10 +297,7 @@ watch(props as Props, () => { if (settings.value.runText) { runTextValue.value = settings.value.runText; } -}); -watch(() => cssPath, () => { - loadTheme(); }); @@ -438,8 +435,8 @@ function loadTheme(): void { const adjustCssFilename = themeNameAdjustments(activeLibrary, useTheme.value); - if (typeof cssPath.value !== 'undefined') { - fetchUrl = cssPath.value; + if (typeof settings.value.cssPath !== 'undefined') { + fetchUrl = settings.value.cssPath; } else { switch (activeLibrary) {