mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-23 01:46:37 +08:00
feat: 完善文章编辑功能
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user