|
@@ -115,7 +115,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();
|
|
|
},
|
|
|
// 输入中文结束时
|
|
@@ -164,12 +164,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);
|
|
|
},
|
|
@@ -204,7 +207,7 @@ export default {
|
|
|
e.target.innerHTML = str.trim();
|
|
|
_this.fullContent = str.trim();
|
|
|
_this.$emit("input", str.trim());
|
|
|
- _this.textFocus();
|
|
|
+ _this.textFocus("tone");
|
|
|
}, 10);
|
|
|
}
|
|
|
});
|