问题描述
我在 store.ts
中有一个数组
export let annotations = writable(new Array<Annotation>());
我想在 component.svelte
中遍历数组:
<script lang="ts">
import { annotations } from '../store';
</script>
<section>
{#each annotations as highlight,index}
...
{/each}
</section>
这失败了:
'Writable
这是有道理的 - Writable
对象不是常规数组,而是 Writable
。
如何迭代 svelte 存储中的数组?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)