mirror of https://github.com/sveltejs/svelte
parent
a0d86dcfe3
commit
bbb676af28
@ -1,18 +1,18 @@
|
||||
<script>
|
||||
export let condition;
|
||||
function foo(node, params) {
|
||||
return {
|
||||
duration: 100,
|
||||
tick: t => {
|
||||
node.foo = t;
|
||||
}
|
||||
};
|
||||
}
|
||||
let bool = true;
|
||||
export let condition;
|
||||
function foo(node, params) {
|
||||
return {
|
||||
duration: 100,
|
||||
tick: t => {
|
||||
node.foo = t;
|
||||
}
|
||||
};
|
||||
}
|
||||
let bool = true;
|
||||
</script>
|
||||
|
||||
<button on:click={() => (condition = false)} />
|
||||
<button on:click={() => (bool = !bool)} />
|
||||
{#if bool}
|
||||
<div out:foo />
|
||||
<div out:foo />
|
||||
{/if}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<script>
|
||||
import Component from "./Component.svelte";
|
||||
let condition = true;
|
||||
import Component from "./Component.svelte";
|
||||
let condition = true;
|
||||
</script>
|
||||
|
||||
{#if condition}
|
||||
<Component bind:condition />
|
||||
<Component bind:condition />
|
||||
{/if}
|
||||
|
@ -1,18 +1,18 @@
|
||||
<script>
|
||||
export let condition;
|
||||
function foo(node, params) {
|
||||
return {
|
||||
duration: 100,
|
||||
tick: t => {
|
||||
node.foo = t;
|
||||
}
|
||||
};
|
||||
}
|
||||
$condition;
|
||||
let bool = true;
|
||||
export let condition;
|
||||
function foo(node, params) {
|
||||
return {
|
||||
duration: 100,
|
||||
tick: t => {
|
||||
node.foo = t;
|
||||
}
|
||||
};
|
||||
}
|
||||
$condition;
|
||||
let bool = true;
|
||||
</script>
|
||||
|
||||
<button on:click={() => (bool = !bool)} />
|
||||
{#if bool}
|
||||
<div out:foo />
|
||||
<div out:foo />
|
||||
{/if}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<script>
|
||||
import { writable } from "svelte/store";
|
||||
import Component from "./Component.svelte";
|
||||
export let condition = writable(true);
|
||||
import { writable } from "svelte/store";
|
||||
import Component from "./Component.svelte";
|
||||
export let condition = writable(true);
|
||||
</script>
|
||||
|
||||
{#if $condition}
|
||||
<button on:click={() => ($condition = false)} id="1" />
|
||||
<Component {condition} />
|
||||
<button on:click={() => ($condition = false)} id="1" />
|
||||
<Component {condition} />
|
||||
{/if}
|
||||
|
Loading…
Reference in new issue