mirror of https://github.com/sveltejs/svelte
parent
bb5d3948ed
commit
2cddada6de
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
get props() {
|
||||
return { show: 'a' };
|
||||
},
|
||||
|
||||
test({ assert, component, target, raf }) {
|
||||
assert.equal(component.el, target.querySelector('div.first'));
|
||||
component.show = 'b';
|
||||
|
||||
raf.tick(200);
|
||||
assert.equal(component.el, target.querySelector('div.second'));
|
||||
}
|
||||
};
|
||||
@ -0,0 +1,16 @@
|
||||
<script>
|
||||
export let el;
|
||||
export let show;
|
||||
|
||||
function foo(node) {
|
||||
return {
|
||||
duration: 100
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if show=="a"}
|
||||
<div class="first" bind:this={el} transition:foo>first</div>
|
||||
{:else if show=="b"}
|
||||
<div class="second" bind:this={el} transition:foo>second</div>
|
||||
{/if}
|
||||
Loading…
Reference in new issue