Skip to content

Commit 45755ea

Browse files
committed
add TransitionDirective
1 parent 683ac71 commit 45755ea

File tree

1 file changed

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

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,16 @@ const visitors = {
455455
},
456456

457457
TransitionDirective(node, context) {
458-
// TODO
458+
const directive = node.intro && node.outro ? 'transition' : node.intro ? 'in' : 'out';
459+
context.write(`${directive}:${node.name}`);
460+
for (const modifier of node.modifiers) {
461+
context.write(`|${modifier}`);
462+
}
463+
if (node.expression !== null) {
464+
context.write('={');
465+
context.visit(node.expression);
466+
context.write('}');
467+
}
459468
},
460469

461470
TypeSelector(node, context) {

0 commit comments

Comments
 (0)