|
|
@@ -129,7 +129,13 @@ onMounted(() => {
|
|
|
:preview-options="{
|
|
|
customCode: {
|
|
|
importCode: `import { initCustomFormatter } from 'vue'`,
|
|
|
- useCode: `initCustomFormatter()`,
|
|
|
+ useCode: `if (window.devtoolsFormatters) {
|
|
|
+ const index = window.devtoolsFormatters.findIndex((v) => v.__vue_custom_formatter)
|
|
|
+ window.devtoolsFormatters.splice(index, 1)
|
|
|
+ initCustomFormatter()
|
|
|
+ } else {
|
|
|
+ initCustomFormatter()
|
|
|
+ }`,
|
|
|
},
|
|
|
}"
|
|
|
/>
|