Github 地址:http://github.com/fex-team/ueditor
文档地址:http://fex.baidu.com/ueditor/#start-start
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ueditor百度富文本</title>
</head>
<style>
</style>
<body>
<div id='app'>
<script id="screenshots" name="screenshots" type="text/plain"></script>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
<script charset="utf-8" src="__PUBLIC__/common/ueditor/ueditor.config.js"></script>
<script charset="utf-8" src="http://cdn.suoluomei.com/common/js/ueditor/ueditor.all.js"></script>
<script>
var Vue = new Vue({
el: '#app',
data: {
},
created() {
},
mounted() {
this.editor = UE.getEditor('screenshots', {
autoHeightEnabled: false,//限制高度不随内容撑高
wordCount: false, //是否开启字数统计
maximumWords: 100000000, //允许的最大字符数
toolbars: [ //头部的配置项,可不设置,将会显示全部
[
'anchor', 'undo', 'redo', 'bold', 'indent', 'italic', 'underline', 'strikethrough', 'subscript',
'superscript', 'formatmatch', 'removeformat', 'fontfamily', 'fontsize', 'attachment', 'simpleupload', 'insertimage',
'link', 'justifyleft', 'justifyright', 'justifycenter', 'justifyjustify',
]
]
});
this.editor.ready(function () {
this.setHeight(300); //设置高度
})
},
methods: {
}
})
</script>
</html>
取值,赋值,清空等
UE.getEditor('screenshots').setContent('xxx'); //赋值
UE.getEditor('screenshots').getContent(); //取值
UE.getEditor('screenshots').setContent('', false);//清空内容
百度文本编辑器的toolbars属性值描述
https://blog.csdn.net/zhengtingvae/article/details/52679591