阅读(1175)
赞(0)
Svelte 默认值
2023-02-20 17:12:52 更新
我们可以轻松地在 Nested.svelte
中为 props 指定默认值:
<script>
export let answer = 'a mystery';
</script>
如果我们现在添加第二个没有 answer
props 的组件,它将回退到默认值:
<Nested answer={42}/>
<Nested/>
我们可以轻松地在 Nested.svelte
中为 props 指定默认值:
<script>
export let answer = 'a mystery';
</script>
如果我们现在添加第二个没有 answer
props 的组件,它将回退到默认值:
<Nested answer={42}/>
<Nested/>
Copyright©2023 编程论坛编程论坛| 浙ICP备2024059924号-1|
违法和不良信息举报电话:|举报邮箱:569242693@qq.com