小编Pro*_*ess的帖子

Svelte - 组件一如何使用组件二的功能?

CompOne 如何运行 CompTwo 中的“test”功能?

CompOne.svelte

<script>
   import {test} from './CompTwo.svelte'
</script>
<!-- Some style and HTML tags for this component -->
Run Code Online (Sandbox Code Playgroud)

CompTwo.svelte

<script>
   export const test = () => { console.log('testing function') }
</script>
<!-- Some style and HTML tags for this component -->
Run Code Online (Sandbox Code Playgroud)

components svelte

4
推荐指数
1
解决办法
6924
查看次数

标签 统计

components ×1

svelte ×1