feat: md-editor暗黑主题调整

This commit is contained in:
张传龙 2023-08-25 10:52:04 +08:00
parent f3125ddec8
commit 81e0bb7b78

View File

@ -13,16 +13,23 @@
保存 保存
</n-button> </n-button>
</div> </div>
<MdEditor v-model="post.content" style="height: calc(100vh - 305px)" dark:bg-dark /> <MdEditor
v-model="post.content"
:theme="appStore.isDark ? 'dark' : 'light'"
style="height: calc(100vh - 305px)"
/>
</CommonPage> </CommonPage>
</template> </template>
<script setup> <script setup>
import { MdEditor } from 'md-editor-v3' import { MdEditor } from 'md-editor-v3'
import 'md-editor-v3/lib/style.css' import 'md-editor-v3/lib/style.css'
import { useAppStore } from '@/store'
defineOptions({ name: 'MDEditor' }) defineOptions({ name: 'MDEditor' })
const appStore = useAppStore()
// refs // refs
let post = ref({}) let post = ref({})
let btnLoading = ref(false) let btnLoading = ref(false)