8***@qq.com
8***@qq.com
  • 发布:2022-10-12 00:39
  • 更新:2023-10-02 14:11
  • 阅读:318

有大佬解释一下为什么会报错吗?数据库的数据能得到,但报警

分类:uniCloud

====================== 下面是报错的地方==============
[Vue warn]: Unhandled error during execution of render function
at <UniClouddbcollection="users"field="_id,username,nicename,power,iconpath,tel,address"getone=true ...>
at <UsermsgpageId=1pagePath="pages/set/other/usermsg"__pageQuery={} ...>
00:35:20.798 TypeError: Cannot read property 'username' of undefined

2022-10-12 00:39 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com (作者)

<template>
<view>
<unicloud-db v-slot:default="{data, loading, error, options}" collection="users" field="_id,username,nicename,power,iconpath,tel,address" :getone="true" :where="_id=='${userid}'">
<view v-if="error">{{error.message}}</view>
<view v-else-if="loading">正在加载...</view>
<view v-else>

            <uni-section title="账号" :subTitle=data.username type="line">  
                <template v-slot:right>  
                    <text v-if="data.power == 0">超级管理员</text>  
                    <text v-if="data.power == 1">管理员</text>  
                    <text v-if="data.power == 2">普通用户</text>  
                    <uni-icons type="contact"></uni-icons>  
                </template>  
            </uni-section>  
            <uni-section title="姓名" type="line">  
                <template v-slot:right>  
                    {{data.nicename}}  
                    <uni-icons type="right"></uni-icons>  
                </template>  
            </uni-section>  
        </view>  
    </unicloud-db>  
</view>  

</template>

8***@qq.com

8***@qq.com (作者)

<unicloud-db v-slot:default="{data, loading, error, options}" collection="users" field="_id,username,nicename,power,iconpath,tel,address" :getone="true" :where="_id=='${userid}'">
</unicloud-db>

y***@163.com

y***@163.com

请问如何解决的,我也是这个问题

要回复问题请先登录注册