Merge pull request #675 from sveltejs/gh-651

run intro transitions on initial render
pull/677/head
Rich Harris 8 years ago committed by GitHub
commit ee5a60fd71

@ -249,7 +249,7 @@ export default function dom(
deindent`
this._fragment.create();
`}
this._fragment.mount( options.target, null );
this._fragment.${block.hasIntroMethod ? 'intro' : 'mount'}( options.target, null );
}
${generator.hasComplexBindings &&

@ -0,0 +1,11 @@
export default {
test ( assert, component, target, window, raf ) {
const div = target.querySelector( 'div' );
assert.equal( div.foo, 0 );
raf.tick(50);
assert.equal( div.foo, 0.5 );
component.destroy();
}
};

@ -0,0 +1,16 @@
<div transition:foo></div>
<script>
export default {
transitions: {
foo: function ( node, params ) {
return {
duration: 100,
tick: t => {
node.foo = t;
}
};
}
}
};
</script>
Loading…
Cancel
Save