提交 369d74fd 编写于 作者: 璃白.'s avatar 璃白. 🌻

feat:添加@事件

上级 89f3b395
此差异已折叠。
......@@ -267,6 +267,7 @@ export default {
selectUser(user) {
const originalText = this.textContent;
const queryInfo = this.queryInfo;
console.log(queryInfo);
const cursorPosition = getPosition(this.id);
const username = user.name + " ";
const newText =
......@@ -287,7 +288,7 @@ export default {
},
handleQueryUser() {
const endPosition = getPosition(this.id);
const startPosition = this.queryInfo.startPosition + 1;
const startPosition = this.queryInfo.startPosition;
const keyWord = this.textContent.slice(startPosition, endPosition);
this.queryInfo.endPosition = endPosition;
......@@ -341,8 +342,8 @@ export default {
};
textEl.parentNode.removeChild(hideEl);
this.showSelectUser = true;
this.queryInfo.startPosition = getPosition(this.id);
this.queryInfo.endPosition = getPosition(this.id);
this.queryInfo.startPosition = getPosition(this.id) + 1;
this.queryInfo.endPosition = getPosition(this.id) + 1;
this.$emit("queryUserList", this.queryInfo.keyWord);
});
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册