提交 56d56c43 编写于 作者: 璃白.'s avatar 璃白. 🌻

🐛 修复@用户时插入位置错误的问题

上级 2c0850be
流水线 #5499 已通过 ,包含阶段
in 1 分5 秒
{ {
"name": "awesome-markdown-editor", "name": "awesome-markdown-editor",
"description": " A open source markdown editor of csdn codechina team contributed", "description": " A open source markdown editor of csdn codechina team contributed",
"version": "1.0.0", "version": "1.1.0",
"publisher": "guoweijia", "publisher": "guoweijia",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
......
...@@ -234,7 +234,9 @@ export default { ...@@ -234,7 +234,9 @@ export default {
showSelectUser: { showSelectUser: {
handler: function(val) { handler: function(val) {
if (!val) { if (!val) {
setTimeout(() => {
this.resetQueryInfo(); this.resetQueryInfo();
}, 50);
} }
} }
} }
......
...@@ -3,7 +3,6 @@ export default { ...@@ -3,7 +3,6 @@ export default {
methods: { methods: {
handleSelectLinkType(index) { handleSelectLinkType(index) {
const originalText = this.textContent; const originalText = this.textContent;
const queryInfo = this.queryInfo;
const cursorPosition = getPosition(this.id); const cursorPosition = getPosition(this.id);
let typeStr = ""; let typeStr = "";
switch (index) { switch (index) {
......
...@@ -24,6 +24,9 @@ export default { ...@@ -24,6 +24,9 @@ export default {
const originalText = this.textContent; const originalText = this.textContent;
const queryInfo = this.queryInfo; const queryInfo = this.queryInfo;
const cursorPosition = getPosition(this.id); const cursorPosition = getPosition(this.id);
console.log('p',cursorPosition,this.queryInfo);
const username = user.nickname + " "; const username = user.nickname + " ";
const newText = const newText =
originalText.slice(0, queryInfo.startPosition) + originalText.slice(0, queryInfo.startPosition) +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册