当前位置: 移动技术网 > IT编程>开发语言>JavaScript > vue 集成 NEditor 富文本

vue 集成 NEditor 富文本

2019年08月07日  | 移动技术网IT编程  | 我要评论

下载neditor 放在  vue 项目下面 public  文件中。

 

安装    vue-neditor-wrap  执行命令

npm  install  vue-neditor-wrap

 

 

代码使用 

 

 

<vueneditorwrap
ref="vueneditorwrap"
v-model="content"
:config="myconfig"
:destroy="false"
@ready="ready"
></vueneditorwrap>
 
myconfig: {
// 如果需要上传功能,找后端小伙伴要服务器接口地址
serverurl:
globalapi.sysapis.itsm_sys_common.itsm_sys_common_upload_api.url,
// 你的ueditor资源存放的路径,相对于打包后的
ueditor_home_url: "/neditor/",
// 编辑器不自动被内容撑高
autoheightenabled: false,
// 初始容器高度
initialframeheight: 240,
// 初始容器宽度
initialframewidth: "100%",
// 关闭自动保存
enableautosave: false,
// 是否只读
readonly: false,
// 最大字数
maximumwords: 2000,
//关闭字数统计
// wordcount: false,
// //关闭elementpath
// elementpathenabled: false,
toolbars: [
[
"source",
"|",
"undo",
"redo",
"|",
"bold",
"italic",
"underline",
"fontborder",
"strikethrough",
"superscript",
"subscript",
"removeformat",
"formatmatch",
"autotypeset",
"blockquote",
"pasteplain",
"|",
"forecolor",
"backcolor",
"insertorderedlist",
"insertunorderedlist",
"selectall",
"cleardoc",
"|",
"rowspacingtop",
"rowspacingbottom",
"lineheight",
"|",
"customstyle",
"paragraph",
"fontfamily",
"fontsize",
"|",
"directionalityltr",
"directionalityrtl",
"indent",
"|",
"justifyleft",
"justifycenter",
"justifyright",
"justifyjustify",
"|",
"touppercase",
"tolowercase",
"|",
"link",
"unlink",
"anchor"
]
]
},
content: ""

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网