mirror of https://github.com/sveltejs/svelte
[fix] run else-if reactive function on re-renders (#6727)
parent
88204355d3
commit
79df74b087
@ -0,0 +1 @@
|
|||||||
|
foo
|
@ -0,0 +1,12 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
foo: true
|
||||||
|
},
|
||||||
|
|
||||||
|
html: 'foo',
|
||||||
|
|
||||||
|
test({ assert, component, target }) {
|
||||||
|
component.foo = false;
|
||||||
|
assert.htmlEqual(target.innerHTML, 'bar');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,13 @@
|
|||||||
|
<script>
|
||||||
|
import Foo from './Foo.svelte'
|
||||||
|
export let foo = true
|
||||||
|
$: bar = () => true
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if foo}
|
||||||
|
<Foo />
|
||||||
|
{:else if bar()}
|
||||||
|
bar
|
||||||
|
{:else}
|
||||||
|
else
|
||||||
|
{/if}
|
Loading…
Reference in new issue