fix: 全局格式化

This commit is contained in:
Tim
2025-08-11 18:16:13 +08:00
parent 31cff70f63
commit 1c4df40f12
76 changed files with 1442 additions and 939 deletions

View File

@@ -13,7 +13,7 @@ import { themeState } from '../utils/theme'
import {
createVditor,
getEditorTheme as getEditorThemeUtil,
getPreviewTheme as getPreviewThemeUtil
getPreviewTheme as getPreviewThemeUtil,
} from '../utils/vditor'
import { clearVditorStorage } from '../utils/clearVditorStorage'
@@ -23,20 +23,20 @@ export default {
props: {
modelValue: {
type: String,
default: ''
default: '',
},
editorId: {
type: String,
default: ''
default: '',
},
loading: {
type: Boolean,
default: false
default: false,
},
disabled: {
type: Boolean,
default: false
}
default: false,
},
},
setup(props, { emit }) {
const vditorInstance = ref(null)
@@ -56,42 +56,42 @@ export default {
watch(
() => props.loading,
val => {
(val) => {
if (!vditorRender) return
if (val) {
vditorInstance.value.disabled()
} else {
vditorInstance.value.enable()
}
}
},
)
watch(
() => props.disabled,
val => {
(val) => {
if (!vditorInstance.value) return
if (val) {
vditorInstance.value.disabled()
} else if (!props.loading) {
vditorInstance.value.enable()
}
}
},
)
watch(
() => props.modelValue,
val => {
(val) => {
if (vditorInstance.value && vditorInstance.value.getValue() !== val) {
vditorInstance.value.setValue(val)
}
}
},
)
watch(
() => themeState.mode,
() => {
applyTheme()
}
},
)
onMounted(() => {
@@ -109,7 +109,7 @@ export default {
vditorInstance.value.disabled()
}
applyTheme()
}
},
})
// applyTheme()
})
@@ -119,7 +119,7 @@ export default {
})
return { editorId }
}
},
}
</script>
@@ -148,5 +148,4 @@ export default {
min-height: 100px;
}
}
</style>