mirror of https://github.com/sveltejs/svelte
parent
9f21043ca6
commit
ed32963d00
@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
let { ref = $bindable(null) } = $props();
|
||||
</script>
|
||||
|
||||
<input bind:this={ref} />
|
||||
@ -0,0 +1,11 @@
|
||||
import { test } from '../../test';
|
||||
import { flushSync } from 'svelte';
|
||||
|
||||
export default test({
|
||||
async test({ assert, target, logs }) {
|
||||
const [btn1] = target.querySelectorAll('button');
|
||||
|
||||
btn1.click();
|
||||
flushSync();
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
|
||||
let state = $state({
|
||||
title: 'foo'
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if state}
|
||||
{@const attributes = { title: state.title }}
|
||||
<Component {...attributes} />
|
||||
{/if}
|
||||
<button
|
||||
onclick={() => {
|
||||
state = undefined;
|
||||
}}
|
||||
>
|
||||
Del
|
||||
</button>
|
||||
Loading…
Reference in new issue