feat: 完善文章编辑功能

This commit is contained in:
橙子
2023-03-12 01:50:11 +08:00
parent 3de32945f2
commit 27962cd25f
13 changed files with 933 additions and 99 deletions

View File

@@ -1,5 +1,6 @@
<template>
<mavon-editor
:v-model="text"
:subfield="subfield"
:codeStyle="props.codeStyle"
:ishljs="true"
@@ -10,15 +11,29 @@
</template>
<script setup>
// Local Registration
import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import { ref } from 'vue';
import { ref,computed,watch } from 'vue';
const props = defineProps(['height','modelValue',"codeStyle"])
const emit=defineEmits(['update:modelValue'])
const subfield = true;
//v-model传值出去
const text = computed({
get() {
return props.modelValue
},
set(value) {
emit('update:modelValue', value)
}
})
const change=(value ,render)=>
{
emit('update:modelValue', render)
console.log(value,"value");
//不用给解析后htm的值给value即可
emit('update:modelValue', value)
}
</script>