vue 富文本编辑器 Editor 使用
NPM版本"wangeditor": "^4.7.4"
isClear2默认false 监听触发清空组件内的富文本编辑器
一般是关闭弹框之类的使用
change也没用上 根据需求来吧
页面注册引用
<EditorThree ref="editorTwo"v-model="formInfo.data.levelInfo":isClear2="isClear2"@change="change2"></EditorThree>
下面为富文本编辑器封装的单组件
<template lang="html"> <div ref="editor" class="text"> </div>
</template> <script>
import E from "wangeditor";
// import "wangeditor/release/wangEditor.min.css";
export default {name: "editoritem",data () {return {// uploadPath,editor: null,info_: null};},model: {prop: "value",event: "change2"},props: {value: {type: String,default: ""},isClear2: {type: Boolean,default: false}},watch: {isClear2 (val) {// 触发清除文本域内容if (val) {this.editor.txt.clear();this.info_ = null;}},value: function (value) {if (value !== this.editor.txt.html()) {this.editor.txt.html(this.value);}}//value为编辑框输入的内容,这里我监听了一下值,当父组件调用得时候,如果给value赋值了,子组件将会显示父组件赋给的值},mounted () {this.seteditor();this.editor.txt.html(this.value);},methods: {seteditor () {// this.editor = new E(this.$refs.toolbar, this.$refs.editor);this.editor = new E(this.$refs.editor);// 配置菜单this.editor.config.menus = [// "head", // 标题"bold", // 粗体"fontSize", // 字号"fontName", // 字体"italic", // 斜体"underline", // 下划线"strikeThrough", // 删除线"foreColor", // 文字颜色"link", // 插入链接"list", // 列表"justify", // 对齐方式"quote", // 引用// 'image', // 插入图片"location" // 位置];this.editor.config.onchange = html => {this.info_ = html; // 绑定当前逐渐地值this.$emit("change2", this.info_); // 将内容同步到父组件中};// 设置高度this.editor.config.height = 200;// 创建富文本编辑器this.editor.create();}}
};
</script> <style lang="css" scoped>
</style>
vue 富文本编辑器 Editor 使用相关推荐
- 小程序 html编辑器,小程序富文本编辑器editor初体验
终于,微信在5月9号的v2.7.0版本中新增了 editor富文本编辑器组件,今天有时间了准备体验一下 在5月6日的时候写了一篇小程序富文本解析的「伪需求」,从wxParse到towxml的坑,当时还 ...
- 小程序(二十五)微信小程序富文本编辑器editor上传图片
官方给出的示例代码中图片上传功能是将图片上传至小程序的缓存中,代码如下所示: insertImage(e) {console.log(e);const that = thiswx.chooseImag ...
- Vue 富文本编辑器插件 vue-quill-editor 坑!
Vue3 + vue-quill-editor 安装步骤: vue3 安装vue-quill-editor npm install @vueup/vue-quill vue2 安装vue-quill- ...
- Element Tiptap Editor - 免费开源的 Vue 富文本编辑器,专门为搭配 Element UI 使用优化,使用很简单
一款很容易上手配置的富文本编辑器,和 Element plus 一起使用效果非常好,还能自定义功能. 关于 Element Tiptap Editor Element Tiptap Editor 是一 ...
- vue富文本编辑器 Vue-Quill-Editor
主流富文本编辑器对比 前言:vue中很多项目都需要用到富文本编辑器,在使用了ueditor和tinymce后,发现并不理想.所以果断使用vue-quill-editor来实现. wangEditor( ...
- Vue富文本编辑器vue-quill-editor-使用-bug问题-教程
vue-quill-editor npm install vue-quill-editor –save or yarn add vue-quill-editor 文件中使用 <template& ...
- layui获取select 文本_小程序富文本编辑器editor初体验
终于,微信在5月9号的v2.7.0版本中新增了 editor富文本编辑器组件,今天有时间了准备体验一下 在5月6日的时候写了一篇小程序富文本解析的「伪需求」,从wxParse到towxml的坑,当时还 ...
- 小程序开发笔记(二):微信小程序富文本编辑器editor的使用
小程序在去年5月的 v2.7.0 版本新增了组件editor富文本编辑器,但对于像我这种开发新手,要熟练使用还是有一定难度.所以记录一下我的学习过程,希望对大家有帮助. 小程序有详细的微信开发 ...
- 博客系统-写文章之富文本编辑器editor
editor 直接再官网下载下来 之后从下载下来的文件选取有用的文件放到项目专门包下,注意下图 可以选择下载好的文件中的上图部分,放入新建md中 然后就是写文章页面 <!DOCTYPE html ...
- vue 富文本编辑器kindeditor使用粘贴图片自动上传图片功能
Kindeditor 的使用这里不再陈述,在KindEditor.create执行时,传入afterCreate方法,在afterCreate的方法里面进行图片上传的功能,这里使用的谷歌浏览器,其他浏 ...
最新文章
- Windows下程序打包发布时的小技巧
- 十六、“心念田园穿古镇,足踏古岸望潭汀。”(2021.5.15)
- Mac系统下安装PIL
- 从VC++到GCC移植:谈两者的语法差异
- 滴滴网约车前端招聘实习生啦
- 渲染百万网页,终于找到影响性能的原因了
- c#位图转换未矢量图_c# 图形图像 | 学步园
- 使用python实现excel常用功能
- python从键盘上输入10个数、求其平均值_从键盘上循环输入10个数,求其平均值,并打印输出....
- 电影爱好者福利,一些电影网站汇总
- deebot扫地机器人说明书_ecovacs扫地机器人730使用说明书_deebot扫地机器说明书
- 【C++学习笔记】基本内置类型和变量
- java中的控制器_SpringMVC基础(一)_控制器
- finalshell root文件夹打不开
- 多对多业务,数据库水平切分架构一次搞定(58沈剑)
- Oracle LiveLabs DB Security (数据库安全)实验汇总
- 开源在今天意味着什么?
- DFR: Deep Feature Reconstruction for Unsupervised Anomaly Segmentation 用于无监督异常分割的深度特征重建
- 让学前端不再害怕英语单词(一)
- 斯坦福大学数据可视化课程学习笔记:第一节 可视化的发展与目标