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

bug fixes

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