<!-- #ifdef H5 -->
<view v-for="(s,index) in student" :key="index">
{
{s.age}}
{
{s.city}}
</view>
<!-- #endif -->
<!-- #ifdef MP -->
小程序会显示
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
安卓和ios会显示
<!-- #endif -->
同样的css也同样适用
/* #ifdef H5 */
.title {
font-size: 36rpx;
color: #8f8f94;
}
/* #endif */
api条件编译
// #ifdef H5
console.log("仅在h5页面显示")
// #endif