冬天的太阳
冬天的太阳
  • 发布:2024-01-03 11:26
  • 更新:2024-01-04 18:07
  • 阅读:100

【重复】unicloud-db组件嵌套,里层db组件where依赖外层循环的数据 里层db组件不能手动更新数据

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15

HBuilderX类型: 正式

HBuilderX版本号: 3.99

第三方开发者工具版本号: 最新

基础库版本号: 最新

项目创建方式: HBuilderX

示例代码:
<unicloud-db ref="udb" v-slot:default="{data, loading, error, options}" collection="pay"    
            :where="`pay_date > ${selectDateStart} && pay_date < ${selectDateEnd} && is_remove == 0`" groupby="pay_date"    
            group-field="sum(pay_num) as payDaySum" orderby="pay_date desc" loadtime="manual">    
            <!-- 循环日期 -->    
            <view class="detail-list" v-for="(item,index) in data" :key="index">    
                <view class="detail-date flex align-center">    
                    <uni-dateformat :date="item.pay_date" format="yyyy-MM-dd"></uni-dateformat>    
                    <view class="body-padding">(¥{{item.payDaySum / 100}})</view>    
                </view>    
                <view class="day-pay bg-white main-margin-top mian-box-shadow main-border-radius">    
                    <unicloud-db ref="udb1" v-slot:default="{data, loading, error, options}" collection="pay, pay-type"    
                        :where="`pay_date == ${item.pay_date} && openid == '${openid}' && is_remove == 0`" orderby="pay_date"    
                        loadtime="manual">    
                        <!-- 每日消费详细 -->    
                        <view class="day-pay-detail flex justify-between main-padding-top-down body-padding main-border-bottom"    
                            v-for="(item1,index) in data" :key="index">    
                            <text>{{item1.pay_type[0].type_name}}</text><text>¥{{item1.pay_num / 100}}</text>    
                        </view>    
                        <!-- 每日消费明细结束 -->    
                    </unicloud-db>    

onReady() {    
            this.$refs.udb.loadData({clear: true})    
            this.$refs.udb1.loadData({clear: true})    

            console.log('udb - ' + this.$refs.udb)    
            console.log(this.$refs.udb1)    
        }    

// 报错: udb1.value.loadData is not a function  

操作步骤:
<unicloud-db ref="udb" v-slot:default="{data, loading, error, options}" collection="pay"    
            :where="`pay_date > ${selectDateStart} && pay_date < ${selectDateEnd} && is_remove == 0`" groupby="pay_date"    
            group-field="sum(pay_num) as payDaySum" orderby="pay_date desc" loadtime="manual">    
            <!-- 循环日期 -->    
            <view class="detail-list" v-for="(item,index) in data" :key="index">    
                <view class="detail-date flex align-center">    
                    <uni-dateformat :date="item.pay_date" format="yyyy-MM-dd"></uni-dateformat>    
                    <view class="body-padding">(¥{{item.payDaySum / 100}})</view>    
                </view>    
                <view class="day-pay bg-white main-margin-top mian-box-shadow main-border-radius">    
                    <unicloud-db ref="udb1" v-slot:default="{data, loading, error, options}" collection="pay, pay-type"    
                        :where="`pay_date == ${item.pay_date} && openid == '${openid}' && is_remove == 0`" orderby="pay_date"    
                        loadtime="manual">    
                        <!-- 每日消费详细 -->    
                        <view class="day-pay-detail flex justify-between main-padding-top-down body-padding main-border-bottom"    
                            v-for="(item1,index) in data" :key="index">    
                            <text>{{item1.pay_type[0].type_name}}</text><text>¥{{item1.pay_num / 100}}</text>    
                        </view>    
                        <!-- 每日消费明细结束 -->    
                    </unicloud-db>    

onReady() {    
            this.$refs.udb.loadData({clear: true})    
            this.$refs.udb1.loadData({clear: true})    

            console.log('udb - ' + this.$refs.udb)    
            console.log(this.$refs.udb1)    
        }    

// 报错: udb1.value.loadData is not a function  

预期结果:

正常更新

实际结果:

不能更新

bug描述:

unicloud-db组件嵌套,里层db组件where依赖外层循环的数据 里层db组件不能手动更新数据

2024-01-03 11:26 负责人:无 分享
已邀请:

要回复问题请先登录注册