NewbieEditor
富文本编辑器 基于 WangEditor
Version: 1.0.0
Props
| Prop name | Description | Type | Values | Default |
|---|---|---|---|---|
| v-model | 输入框的值@model true | string | - | "" |
| placeholder | 占位符 | string | - | "请输入内容..." |
| disabled | 是否禁用 | boolean | - | false |
| readonly | 是否只读 | boolean | - | false |
| config | @params .toolbarConfig 工具栏配置@params .editorConfig 编辑器配置 | object | - | { toolbarConfig: {}, editorConfig: {} } |
Events
| Event name | Properties | Description |
|---|---|---|
| update:value |
方法
| 名称 | 参数 | 说明 |
|---|---|---|
| setContent | (content:string) => void | 设置编辑器内容 |
Provider
| 名称 | 参数 | 说明 |
|---|---|---|
| uploadUrl | string | 编辑器中的图片,文件上传路径 |
<NewbieProvider :eidtor="{uploadeUrl: 'somewhere-that-can-upload-files'}" />
示例
<template>
<Button type="primary" @click="getContent">获取内容</Button>
<NewbieEditor v-model:value="content" placeholder="来吧,写吧" />
</template>
<script setup>
import { NewbieEditor } from "jobsys-newbie"
import { message, Button } from "ant-design-vue"
import { ref } from "vue"
const content = ref("")
const getContent = () => {
message.success(content.value)
}
</script>