利用条件编译在app端使用h5
在 uni-app 中可以使用条件编译发挥各自平台的特色能力,h5+ 对象为 plus,在js中我们可以通过条件编译调用它 ^_^
语法格式
// #ifdef APP-PLUS
plus.***.***;
// #endif
关于 hcoder
export default {
methods:{
openhcoder : function(){
plus.runtime.openURL("http://www.hcoder.net");
}
},
onLoad:function(){
// #ifdef APP-PLUS
plus.nativeUI.toast('hi..');
// #endif
if(a == b){
console.log('hi..');
}
}
}
.content{text-decoration: line-through;}
.a{display: block;border-right-width:10px;}