[Lifecycle Error] call Component onInit method fail:
Cannot read property 'catchhook:onInit' of undefined
TypeError: [Lifecycle Error] call Component onInit method fail:
Cannot read property 'catchhook:onInit' of undefined
<template>
<view>
<unicloud-db ref="udb" v-slot:default="{data, loading, error, options}" :options="formData" collection="opendb-news-articles"
field="_id,title" :where="where" @load="load">
<view v-for="item in data">
{{item.title}}
</view>
</unicloud-db>
</view>
</template>
<script>
export default {
data() {
return {
where: "",
formData: {
waterfall: false, // 布局方向切换
status: 'loading', // 加载状态
},
}
},
onLoad(){
},
methods: {
load(data, ended) {
if (ended) {
this.formData.status = 'noMore'
}
},
}
}
</script>
y***@yeah.net (作者)
谢谢官方大大
2022-04-06 21:11