We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f3a17c commit b8eb99bCopy full SHA for b8eb99b
1 file changed
packages/plugins/script/src/js/method.ts
@@ -193,7 +193,7 @@ const setEditorSelection = () => {
193
)
194
}
195
196
-export const highlightMethod = (name) => {
+export const highlightMethod = async (name) => {
197
if (!name) {
198
return
199
@@ -216,6 +216,9 @@ export const highlightMethod = (name) => {
216
217
218
if (state.editorSelection) {
219
+ // 兼容初始化进来时,state.script 为空,需要等待一个 tick 之后再设置选中
220
+ // 否则直接设置选中,此时 state.script 为空,设置无效
221
+ await nextTick()
222
setEditorSelection()
223
224
0 commit comments