mirror of https://github.com/sveltejs/svelte
parent
42af2bb32b
commit
f06eced938
@ -0,0 +1,16 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
things: [ 'a', 'b', 'c' ]
|
||||||
|
},
|
||||||
|
|
||||||
|
test ( assert, component, target, window, raf ) {
|
||||||
|
const divs = target.querySelectorAll( 'div' );
|
||||||
|
|
||||||
|
component.set({ things: [ 'a' ] });
|
||||||
|
|
||||||
|
raf.tick( 50 );
|
||||||
|
assert.equal( divs[0].foo, undefined );
|
||||||
|
assert.equal( divs[1].foo, 0.5 );
|
||||||
|
assert.equal( divs[2].foo, 0.5 );
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,18 @@
|
|||||||
|
{{#each things as thing}}
|
||||||
|
<div out:foo>{{thing}}</div>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
transitions: {
|
||||||
|
foo: function ( node, params ) {
|
||||||
|
return {
|
||||||
|
duration: 100,
|
||||||
|
tick: t => {
|
||||||
|
node.foo = t;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue