onShow(){
var that = this;
that.getPlatform();
},
methods: {
getPlatform(){
var that = this;
switch(uni.getSystemInfoSync().platform){
case 'android':
console.log('运行Android上')
break;
case 'ios':
console.log('运行iOS上')
break;
default:
console.log('运行在开发者工具上')
break;
}
},
},
uni-app判断客户端环境是 Android、iOS 还是小程序开发工具
最新推荐文章于 2024-04-10 17:50:30 发布