uni-app 中$refs 在app中无法使用

uniapp 的坑还是很多

$refs在app或者支付宝小程序里不可用 显示undefined

解决办法this.$nextTick(()=>{})

onLoad(option) {
            console.log(option)
            console.log(option.id)
            if(option.id!=undefined){
                this.id=option.id;
                this.data.id=option.id;
                this.$nextTick(()=>{
                        console.log("ref",this.$refs.sidestationbasicinfo)
                        this.$refs.sidestationbasicinfo.getData(option.id);
                })
                
                
            }else{
                this.type=option.type;
                this.data.jjsj=Time.CurentTime(new Date(),"YYYY-MM-DD");
            }
        },

  这是app的解决办法其他的没试过

好像原生的view也拿不到

原文地址:https://www.cnblogs.com/fhysy/p/14717431.html