|
@@ -110,7 +110,7 @@ export default {
|
|
|
this.lock = false;
|
|
|
let id = '#' + this.id;
|
|
|
document.querySelector(id).focus();
|
|
|
- document.execCommand('selectAll', false, null);
|
|
|
+ // document.execCommand('selectAll', false, null);
|
|
|
document.getSelection().collapseToEnd();
|
|
|
},
|
|
|
// 输入中文结束时
|
|
@@ -159,12 +159,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 文本输入框聚焦,焦点在最后位置
|
|
|
- textFocus() {
|
|
|
+ textFocus(type) {
|
|
|
let _this = this;
|
|
|
setTimeout(() => {
|
|
|
let id = '#' + _this.id;
|
|
|
document.querySelector(id).focus();
|
|
|
- document.execCommand('selectAll', false, null);
|
|
|
+ if (type === 'tone') {
|
|
|
+ document.execCommand('selectAll', false, null);
|
|
|
+ }
|
|
|
+
|
|
|
document.getSelection().collapseToEnd();
|
|
|
}, 0);
|
|
|
},
|
|
@@ -201,7 +204,7 @@ export default {
|
|
|
e.target.innerHTML = str.trim();
|
|
|
_this.fullContent = str.trim();
|
|
|
_this.$emit('input', str.trim());
|
|
|
- _this.textFocus();
|
|
|
+ _this.textFocus('tone');
|
|
|
}, 10);
|
|
|
}
|
|
|
});
|