vue 集成 NEditor 富文本


下載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資源存放的路徑,相對於打包后的index.html
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: ""

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM