m***@gmail.com
m***@gmail.com
  • 发布:2023-12-26 13:57
  • 更新:2024-01-29 00:33
  • 阅读:427

[Vue warn]: Failed to resolve component: uni-list-item

分类:uni-app

我是在做公共插件开发时候,在uni_modules下建了插件,在插件中引入了 uni-list , 插件的依赖都已经安装。
在插件中使用组件:

<template>  
    <view class="container">  
        <uni-list>  
            <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'person-filled' }" title="昵称"  
                :rightText="user.nickName" />  
            <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'phone-filled' }" title="手机号码"  
                :rightText="user.phonenumber" />  
            <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'email-filled' }" title="邮箱" :rightText="user.email" />  
            <!-- <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'auth-filled' }" title="岗位" :rightText="postGroup" /> -->  
            <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'staff-filled' }" title="角色" :rightText="roleGroup" />  
            <uni-list-item showExtraIcon="true" :extraIcon="{ type: 'calendar-filled' }" title="创建日期"  
                :rightText="user.createTime" />  
        </uni-list>  
    </view>  
</template>

刷新页面都会报这个错误:

uni-h5.es.js:15495 [Vue warn]: Failed to resolve component: uni-list-item
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
at <Index>
at <AsyncComponentWrapper>
at <PageBody>
at <Page>
at <Anonymous>
at <KeepAlive>
at <RouterView>
at <Layout>
at <App>

想请教下这个问题到底是哪里出了问题?

2023-12-26 13:57 负责人:无 分享
已邀请:
l***@163.com

l***@163.com

遇到过这个问题,自己排查发现的原因可能是文件名问题,vue页面文件名不支持某些驼峰命名,我修改了文件名就好了,真尴尬啊

要回复问题请先登录注册