diff --git a/src/components/editor/CodeEditor.vue b/src/components/editor/CodeEditor.vue index ce470a8..f6f7683 100644 --- a/src/components/editor/CodeEditor.vue +++ b/src/components/editor/CodeEditor.vue @@ -253,7 +253,7 @@ export default defineComponent({ let createDependencyProposals = (range, completions, curWord) => { let keys = []; // fix getValue of undefined - const tokens = getTokens(this.codeEditor.getModel()?.getValue()); + const tokens = getTokens(this.codeEditor?.getModel()?.getValue()); // 自定义变量、字符串 for (const item of tokens) { if (item != curWord.word) {