We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbe7109 commit 3990807Copy full SHA for 3990807
packages/compiler-sfc/src/compileScript.ts
@@ -1225,12 +1225,12 @@ export function compileScript(
1225
} else {
1226
let start = decl.start! + startOffset
1227
let end = decl.end! + startOffset
1228
- if (i === 0) {
1229
- // first one, locate the start of the next
1230
- end = node.declarations[i + 1].start! + startOffset
1231
- } else {
1232
- // not first one, locate the end of the prev
+ if (i === total - 1) {
+ // last one, locate the end of the prev
1233
start = node.declarations[i - 1].end! + startOffset
+ } else {
+ // not last one, locate the start of the next
+ end = node.declarations[i + 1].start! + startOffset
1234
}
1235
s.remove(start, end)
1236
left--
0 commit comments