解决编辑命令后不刷新的 bug

This commit is contained in:
fofolee
2022-04-10 00:35:22 +08:00
parent dc2e68e86f
commit e86fb1b02a

View File

@@ -345,10 +345,15 @@ export default {
}); });
this.closeEditor(); this.closeEditor();
this.$nextTick(() => { this.$nextTick(() => {
document // 先点一次,如果是停用状态则被启用
.getElementById(this.quickcommandInfo.features.code) // 如果是启用状态则停用
.querySelector(".q-toggle[aria-checked='false']") let dom = document.getElementById(this.quickcommandInfo.features.code);
?.click(); dom.querySelector(".q-toggle")?.click();
// 如果之前一次点击是启用则不点
// 如果之前一次点击是停用则再点一次启用,达到刷新目的
this.$nextTick(() => {
dom.querySelector(".q-toggle[aria-checked='false']")?.click();
});
}); });
}, },
// 运行 // 运行