mirror of https://github.com/sveltejs/svelte
parent
3c6af50378
commit
d5bca1140f
@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import { onDestroy } from 'svelte';
|
||||
|
||||
let { my_prop } = $props();
|
||||
export let my_prop;
|
||||
|
||||
onDestroy(() => {
|
||||
console.log(my_prop.foo);
|
||||
@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
|
||||
let value = $state({ foo: 'bar' });
|
||||
let value = { foo: 'bar' };
|
||||
</script>
|
||||
|
||||
<button
|
||||
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
let { ref = $bindable(null) } = $props();
|
||||
export let ref;
|
||||
</script>
|
||||
|
||||
<input bind:this={ref} />
|
||||
@ -1,9 +1,7 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
|
||||
let state = $state({
|
||||
title: 'foo'
|
||||
});
|
||||
let state = { title: 'foo' };
|
||||
</script>
|
||||
|
||||
{#if state}
|
||||
Loading…
Reference in new issue