事件计算 属性 问题

Event Computed property issue

我正在学习 Svelte,我想知道为什么点击事件在这个例子中不起作用。我收到一条错误消息:

TypeError: each_value is undefined'

https://svelte.technology/repl?version=1.56.1&gist=798be31e79dfbf363a9f7e497557acfb

<p><input bind:value=search></p>

{{#each categories.filter(predicate) as category}}
  <!-- the click event should work, right? -->
    <button on:click='console.log(category)'>{{category}}</button>
{{/each}}

<script>
    export default {
        data() {
            return {
                search: '',
                categories: [
                    'animal',
                    'vegetable',
                    'mineral'
                ]
            }
        },
      computed: {
            predicate: search => {
                search = search.toLowerCase();
                return word => word.startsWith(search);
            }
        }
    };
</script>

这似乎是 1.56 中引入的错误 — 如果您 change the version in the URL to 1.55,它会起作用。我们会把它修好。谢谢!