You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/lifecycle-render-order-for-.../Item.svelte

30 lines
466 B

<script>
import { onMount, beforeUpdate, afterUpdate } from 'svelte';
import order from './order.js';
export let index;
export let id;
export let name;
function logRender () {
order.push(`${index}: render`);
return index;
}
beforeUpdate(() => {
order.push(`${index}: beforeUpdate`);
});
afterUpdate(() => {
order.push(`${index}: afterUpdate`);
});
onMount(() => {
order.push(`${index}: onMount`);
});
</script>
<li>
{logRender()}
</li>