diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 1b66e283c6a..e26cddc0ae9 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1230,7 +1230,7 @@ export function compileScript( // last one, locate the end of the prev start = node.declarations[getLastIndex(i)].end! + startOffset } else { - // not last one, locate the start of the next + // not the last one, locate the start of the next end = node.declarations[i + 1].start! + startOffset } s.remove(start, end)