607 uniapp条件编译
作者:互联网
<template>
<view>
<!-- 条件编译 -->
<!-- 编译到H5端 -->
<!-- #ifdef H5 -->
<btn></btn>
<!-- #endif -->
<!-- 编译到H5端、app端 -->
<!-- #ifdef H5 || APP-PLUS -->
<btn backgroundColor="yellowgreen"></btn>
<!-- #endif -->
<!-- 编译到除了H5端的平台,这样就不会在H5端显示 -->
<!-- #ifndef H5 -->
<btn backgroundColor="pink"></btn>
<!-- #endif -->
</view>
</template>
<script>
import btn from '@/components/btn/btn.vue'
export default {
components: {
btn
},
onl oad() {
// #ifdef H5
// #endif
uni.getSystemInfo({
success(res) {
console.log('success---', res);
},
fail(rej) {
console.log('fail---', rej);
},
complete(msg) {
console.log('complete---', msg);
}
})
}
}
</script>
<style scoped>
/* #ifdef H5 */
/* #endif */
</style>
标签:uniapp,607,console,log,---,编译,ifdef,fail,btn 来源: https://www.cnblogs.com/jianjie/p/14401513.html