mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-02 15:07:11 +00:00
no message
This commit is contained in:
parent
a723c2a44a
commit
ab66b70485
@ -210,8 +210,7 @@ export default {
|
||||
}
|
||||
|
||||
// set value and clear selection
|
||||
this.editor.setValue(this.value)
|
||||
this.editor.clearSelection()
|
||||
this.setValue(this.value)
|
||||
|
||||
// set ace editor options and theme
|
||||
this.editor.setOptions(this.options)
|
||||
@ -264,6 +263,17 @@ export default {
|
||||
this.$nextTick(() => this.editor && this.editor.resize())
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置内容
|
||||
* @param value
|
||||
*/
|
||||
setValue(value) {
|
||||
if (typeof value === "string" && this.editor) {
|
||||
this.editor.setValue(value)
|
||||
this.editor.clearSelection()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取文件类型
|
||||
* @returns {string}
|
||||
@ -359,8 +369,7 @@ export default {
|
||||
if (newCode == this.code) {
|
||||
return;
|
||||
}
|
||||
this.editor.setValue(newCode)
|
||||
this.editor.clearSelection()
|
||||
this.setValue(newCode)
|
||||
const {row, column} = this.cursorPosition
|
||||
// move cursor to current position
|
||||
this.editor.selection.moveCursorTo(row, column)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user