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

@@ -1,17 +1,13 @@
<template>
<div class="comment-editor-container">
<div class="comment-editor-wrapper">
<div class="comment-editor-wrapper">
<div :id="editorId" ref="vditorElement"></div>
<LoginOverlay v-if="showLoginOverlay" />
</div>
<div class="comment-bottom-container">
<div class="comment-submit" :class="{ disabled: isDisabled }" @click="submit">
<template v-if="!loading">
发布评论
</template>
<template v-else>
<i class="fa-solid fa-spinner fa-spin"></i> 发布中...
</template>
<template v-if="!loading"> 发布评论 </template>
<template v-else> <i class="fa-solid fa-spinner fa-spin"></i> 发布中... </template>
</div>
</div>
</div>
@@ -23,7 +19,7 @@ import { themeState } from '../utils/theme'
import {
createVditor,
getEditorTheme as getEditorThemeUtil,
getPreviewTheme as getPreviewThemeUtil
getPreviewTheme as getPreviewThemeUtil,
} from '../utils/vditor'
import LoginOverlay from './LoginOverlay.vue'
import { clearVditorStorage } from '../utils/clearVditorStorage'
@@ -34,24 +30,24 @@ export default {
props: {
editorId: {
type: String,
default: ''
default: '',
},
loading: {
type: Boolean,
default: false
default: false,
},
disabled: {
type: Boolean,
default: false
default: false,
},
showLoginOverlay: {
type: Boolean,
default: false
default: false,
},
parentUserName: {
type: String,
default: ''
}
default: '',
},
},
components: { LoginOverlay },
setup(props, { emit }) {
@@ -87,7 +83,7 @@ export default {
placeholder: '说点什么...',
preview: {
actions: [],
markdown: { toc: false }
markdown: { toc: false },
},
input(value) {
text.value = value
@@ -97,7 +93,7 @@ export default {
vditorInstance.value.disabled()
}
applyTheme()
}
},
})
// applyTheme()
})
@@ -108,37 +104,37 @@ export default {
watch(
() => props.loading,
val => {
(val) => {
if (!vditorInstance.value) return
if (val) {
vditorInstance.value.disabled()
} else if (!props.disabled) {
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(
() => themeState.mode,
() => {
applyTheme()
}
},
)
return { submit, isDisabled, editorId }
}
},
}
</script>