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 0fbc19f commit df48eecCopy full SHA for df48eec
packages/compiler-sfc/src/compileScript.ts
@@ -1219,12 +1219,12 @@ export function compileScript(
1219
} else {
1220
let start = decl.start! + startOffset
1221
let end = decl.end! + startOffset
1222
- if (i === 0) {
1223
- // first one, locate the start of the next
1224
- end = node.declarations[i + 1].start! + startOffset
1225
- } else {
1226
- // not first one, locate the end of the prev
+ if (i === total - 1) {
+ // last one, locate the end of the prev
1227
start = node.declarations[i - 1].end! + startOffset
+ } else {
+ // not last one, locate the start of the next
+ end = node.declarations[i + 1].start! + startOffset
1228
}
1229
s.remove(start, end)
1230
left--
0 commit comments