写组件时遇到的问题
<script lang="ts" context="module"> import type {ComponentProps} from 'svelte' import Box from './Box.svelte' </script> <script lang="ts"> type $$Props = ComponentProps<Box> </script> <Box {...$$props}><path d="m7 10 5 5 5-5z"/></Box>
参考资料:
https://github.com/dummdidumm/rfcs/blob/ts-typedefs-within-svelte-components/text/ts-typing-props-slots-events.md
最后更新于1年前