SomeoneElse
SomeoneElse
  • 发布:2023-08-09 16:53
  • 更新:2023-10-10 16:03
  • 阅读:203

Vue3+TypeScript组合式API没有组件props类型提示

分类:uni-app

组件在 components 目录下定义的(easycom模式)

<script lang="ts" name="list-item" setup>  
    interface Props {  
        iconPath: string;  
        iconBg?: string;  
        title?: string;  
        desc?: string;  
    }  

    const props = withDefaults(defineProps<Props>(), {  
        iconBg: "#E0EAFF",  
        title: "",  
        desc: ""  
    });  
</script>

在其他页面中使用 list-item 组件,没有Props的类型提示,按住 alt 点 prop 也不会跳转到定义,悬浮上去显示是 JSX attribute,不知道为啥。。。

2023-08-09 16:53 负责人:无 分享
已邀请:
_yin

_yin

请问解决了吗

  • SomeoneElse (作者)

    没有

    2023-10-23 03:12

  • SomeoneElse (作者)

    还是用vscode吧,HbuilderX太难用了

    2023-10-23 03:12

要回复问题请先登录注册