fo-editor-vue
v0.3.23
Published
editor
Readme
fo-editor-vue
最新文档请移步官方地址
Vue3 组件使用方式
安装依赖
npm install fo-editor-vue --save
OR
yarn add fo-editor-vue
集成使用
<template>
<VueEditor ref="editorRef" @onChange="onChange" :defaultValue="value"/>
</template>
<script setup lang="tsx">
import { shallowRef } from "vue";
import { VueEditor, FoEditor } from 'fo-editor-vue';
const editorRef = shallowRef<FoEditor>();
// json 文档
const value = `{...}`;
// 感知 onChange 变化
const onChange = ({ docChanged }: { docChanged: boolean }) => {
if (docChanged) {
console.log('doc changed:', editorRef.value().toValue());
} else {
console.log('光标变化等');
}
};
</script>