====================== 下面是报错的地方==============
[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
- 更新:2023-10-02 14:11
- 阅读:318
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 (作者)
<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>