zs-editor 富文本编辑器组件
功能描述
基于 wangEditor 的富文本编辑器组件,支持多种编辑功能,如加粗、斜体、列表、图片上传等。
属性
| 属性名 | 类型 | 说明 |
|---|---|---|
| modelValue | string | 编辑器内容 |
事件
| 事件名 | 说明 | 参数 |
|---|---|---|
| change | 编辑器内容变化时触发 | 更新后的内容 |
使用示例
vue
<template>
<zs-editor
v-model="content"
@change="handleChange"
/>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import ZsEditor from '@/components/zs-editor';
const content = ref('<p>初始内容</p>');
const handleChange = (value: string) => {
console.log('编辑器内容变化:', value);
};
</script>