如何使用Typescript,Pug Template Engine和Coption API在VUE3中创建组件
当我在<脚本设置中导出组件时但从未使用过。
例如:
<template lang="pug">
div
// In kebab-case e.g. hello-world also have same issue
HelloWorld
</template>
<script setup lang="ts">
import HelloWorld from'@/components/HelloWorld.vue';
</script>
这是投掷 错误: 'Helloworld'已定义但从未使用过
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了这个解决方案:
因此,主要思想是我们应该清楚地定义我们的组件。根据如果需要的话,我们可以使用2个脚本标签!
希望它有用
I found this solution:
So, the main idea is that we should clearly define our components. According to https://vuejs.org/api/sfc-script-setup.html#usage-alongside-normal-script we can use 2 script tags, if we need!
Hope it was useful