z***@126.com
z***@126.com
  • 发布:2024-04-23 21:13
  • 更新:2024-04-23 21:13
  • 阅读:181

求解决:Error in onLoad hook (Promise/async): "ReferenceError: adlist is not defined"

分类:uniCloud

<script>
export default {

    data() {  
        return {  
            adlist:[],  
            goods_th:"",  
            active:0,  
            rightHeightArr:[],  
            rightScrollVal:0,  
        }  
    },  
    async onLoad() {  
        const db = uniCloud.database();  
        const goodst =  db.collection('goods')  
                    .field( 'categoryId,price , title as gtitle , image as gimage' )  
                    .getTemp();  
        const categ = db.collection('category')  
                    .field('_id,title,image')  
                    .getTemp();  
        let g = await db.collection(goodst,categ)  
                    .field('categ{image},title,gtitle,gimage,price')  
                    .get();  
        this.adlist = g.result.data  
        console.log('adlist',adlist)  

    },  
    methods: {  
        activeChange(index){  
            this.active=index  
            this.rightScrollVal = this.rightHeightArr[index]  
    },  

    }  
}  

</script>

2024-04-23 21:13 负责人:无 分享
已邀请:

要回复问题请先登录注册