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/store-computed/Todo.html

15 lines
336 B

{{#if isVisible}}
<div class='{{todo.done ? "done": "pending"}}'>{{todo.description}}</div>
{{/if}}
<script>
export default {
computed: {
isVisible: ($filter, todo) => {
if ($filter === 'all') return true;
if ($filter === 'done') return todo.done;
if ($filter === 'pending') return !todo.done;
}
}
};
</script>