From 3404c87a7109f0057ae6c7328ac8a745bfb6c4a0 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 21 Jun 2023 19:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=B9=E9=94=99=E5=88=A4?= =?UTF-8?q?=E6=96=AD,=20=E9=81=BF=E5=85=8Dvscode=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=97=B6=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=8F=92=E4=BB=B6=E6=8A=BD?= =?UTF-8?q?=E9=A3=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/compile-vue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compile-vue.js b/lib/compile-vue.js index 33097c5..3fae656 100644 --- a/lib/compile-vue.js +++ b/lib/compile-vue.js @@ -289,7 +289,7 @@ export function compileVue(file, imports, options = {}) { let js = code.match(JS_EXP) let scss = [...code.matchAll(STYLE_EXP)] let html = code.match(HTML_EXP) || ['', ''] - let linePatch = code.slice(0, js.index).split('\n').length // js起始行数修正 + let linePatch = code.slice(0, js?.index || 0).split('\n').length // js起始行数修正 let hash = md5(file) let scopeId = 'data-' + hash