增加容错判断, 避免vscode保存时格式化插件抽风
parent
1b3425196e
commit
3404c87a71
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue