Skip to content

Commit 208262c

Browse files
committed
fix: hasIf should only be set to true if an if clause was appended before
1 parent 5ae135a commit 208262c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function compileRouteMatch(ctx: CompilerContext): string {
9191
const node = ctx.router.static[key];
9292
if (node?.methods) {
9393
code += `${hasIf ? "else " : ""}if(p===${JSON.stringify(key.replace(/\/$/, "") || "/")}){${compileMethodMatch(ctx, node.methods, [], -1)}}`;
94+
hasIf = true;
9495
}
95-
hasIf = true;
9696
}
9797
}
9898

0 commit comments

Comments
 (0)