提交 3e740efe authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 f0bebcce
......@@ -10,7 +10,7 @@ export default {
name: 'VEditor',
props: {
value: { type: String },
disabled: { type: Boolean, default: null }
disabled: { type: Boolean, default: false }
},
data() {
return {
......@@ -49,16 +49,7 @@ export default {
'/',
{
name: 'basicstyles',
items: [
'Bold',
'Italic',
'Underline',
'Strike',
'Subscript',
'Superscript',
'-',
'RemoveFormat'
]
items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
},
{
name: 'paragraph',
......@@ -86,14 +77,12 @@ export default {
]
}
if (this.disabled !== null) {
config.readOnly = this.disabled
}
// if (this.disabled !== null) {
// console.log(this.disabled)
// config.readOnly = this.disabled
// }
const editor = (this.ckEditor = CKEDITOR.replace(
this.textareaElementId,
config
))
const editor = (this.ckEditor = CKEDITOR.replace(this.textareaElementId, config))
editor.on('instanceReady', () => {
const data = this.value
editor.fire('lockSnapshot')
......@@ -118,6 +107,7 @@ export default {
editor.fire('unlockSnapshot')
}
})
editor.setReadOnly(this.disabled)
})
},
bindEvent() {
......
......@@ -10,7 +10,7 @@ export default {
name: 'VEditor',
props: {
value: { type: String },
disabled: { type: Boolean, default: null }
disabled: { type: Boolean, default: false }
},
data() {
return {
......@@ -49,16 +49,7 @@ export default {
'/',
{
name: 'basicstyles',
items: [
'Bold',
'Italic',
'Underline',
'Strike',
'Subscript',
'Superscript',
'-',
'RemoveFormat'
]
items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']
},
{
name: 'paragraph',
......@@ -85,14 +76,13 @@ export default {
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] }
]
}
if (this.disabled !== null) {
config.readOnly = this.disabled
}
const editor = (this.ckEditor = CKEDITOR.replace(
this.textareaElementId,
config
))
// if (this.disabled !== null) {
// console.log(this.disabled)
// config.readOnly = this.disabled
// }
const editor = (this.ckEditor = CKEDITOR.replace(this.textareaElementId, config))
editor.on('instanceReady', () => {
const data = this.value
editor.fire('lockSnapshot')
......@@ -117,6 +107,7 @@ export default {
editor.fire('unlockSnapshot')
}
})
editor.setReadOnly(this.disabled)
})
},
bindEvent() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论