Skip to content

Commit 0b9f560

Browse files
committed
KeyBlock
1 parent 566da5b commit 0b9f560

File tree

1 file changed

+9
-1
lines changed
  • packages/svelte/src/compiler/print

1 file changed

+9
-1
lines changed

packages/svelte/src/compiler/print/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function print(ast) {
1616
});
1717
}
1818

19-
/** @type {Visitors<AST.SvelteNode | AST.CSS.Node, any>} */
19+
/** @type {Visitors<AST.SvelteNode, any>} */
2020
const visitors = {
2121
Root(node, context) {
2222
if (node.options) {
@@ -354,6 +354,14 @@ const visitors = {
354354
}
355355
},
356356

357+
KeyBlock(node, context) {
358+
context.write('{#key ');
359+
context.visit(node.expression);
360+
context.write('}');
361+
context.visit(node.fragment);
362+
context.write('{/key}');
363+
},
364+
357365
LetDirective(node, context) {
358366
context.write(`let:${node.name}`);
359367
if (

0 commit comments

Comments
 (0)