//设置readonly: this.readonly
//从父组件传readonly值到tinymce富文本编辑器
initTinymce() {
const _this = this
window.tinymce.init({
selector: `#${this.tinymceId}`,
language: this.languageTypeList['zh'],
height: this.height,
body_class: 'panel-body ',
object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
menubar: this.menubar,
readonly: this.readonly,
plugins: plugins,
end_container_on_empty_block: true,
powerpaste_word_import: 'clean',
code_dialog_height: 450,
code_dialog_width: 1000,
advlist_bullet_styles: 'square',
advlist_number_styles: 'default',
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
default_link_target: '_blank',
link_title: false,
nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin
init_instance_callback: editor => {
if (_this.value) {
editor.setContent(_this.value)
}
_this.hasInit = true
editor.on('NodeChange Change KeyUp SetContent', () => {
this.hasChange = true
this.$emit('input', editor.getContent())
})
},
setup(editor) {
editor.on('FullscreenStateChanged', e => {
_this.fullscreen = e.state
})
},
convert_urls: false
})
},
tinymce在详情页面中仅读
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 第一个,因为分页查询的数据列表是post请求,叫后台改成get请求。、
- 需求:点击下方小图时,上方大图转换为相对应小图。 代码实现部分 注:此文章为作者第一次使用vue做电商网站时的小结...
- html5 产品列表点击其中一个产品进入产品详情,从产品详情页面返回到产品页面,要实现点击回到那个产品的位置 比较...
- 1.params,跟query都可以实现,但是query将参数暴露在url不安全,params则是用户手动刷新页面...
