一个vue页面只能有一个
document.addEventListener("plusready", this.plusReady, true);
}
吗
我知道document.addEventListener("plusready", this.plusReady, true)这个是为了使用plus对象之前先确保它已经准备好,所有用到plus对象的页面都要加上这行代码。那么这行代码在一个.vue文件里面只能写一个吗。
mounted() {
if(window.plus){
this.plusReady();
}else{
document.addEventListener("plusready", this.plusReady, false);
}
},
plusReady(){
alert('你好啊')
window.plus.plugintest.registerReceiver(this.qingqiu());
},
但是我不想让window.plus.plugintest.registerReceiver(this.qingqiu());写在plusReady(),我想让折叠面板展开之后在执行window.plus.plugintest.registerReceiver(this.qingqiu());这行代码,而不是一开始页面加载后就直接执行了