Skip to content

Commit

Permalink
fix: 修正编辑时文章没有加载
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Jan 4, 2024
1 parent 24256e1 commit 461c6f0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/admin/src/components/md-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import ky from 'ky'
import VueMavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import {ref, unref} from 'vue'
import {computed, ref, unref} from 'vue'
const MavonEditor = VueMavonEditor.mavonEditor
const props = defineProps({
Expand All @@ -23,7 +23,14 @@ const props = defineProps({
},
})
const emit = defineEmits(['update:modelValue', 'attachAdd'])
const content = ref(props.modelValue)
const content = computed({
get() {
return props.modelValue
},
set(val: string) {
emit('update:modelValue', val)
},
})
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-assignment
const editor = ref<any>(null)
Expand Down

0 comments on commit 461c6f0

Please sign in to comment.