1***@qq.com
1***@qq.com
  • 发布:2023-12-20 09:34
  • 更新:2023-12-20 10:54
  • 阅读:89

使用脚手架搭建的vue3项目,使用pug编译html,怎么写条件编译

分类:uni-app
<template lang="pug">  
    <!-- #ifdef MP-WEIXIN -->  
    JumpApplet(@jumpApplet="jumpApplet")  
    <!-- #endif -->  
</template>

按照上面写的不生效

2023-12-20 09:34 负责人:无 分享
已邀请:

最佳回复

DCloud_UNI_OttoJi

DCloud_UNI_OttoJi - 日常回复 uni-app/x 问题,如果艾特我没看到,请主动私信

demo 地址 https://gitcode.net/xiurensha5731/uni-app-questions/-/tree/q/pug-ifdef

<template lang="pug">  
div  
  // #ifdef MP-WEIXIN  
  div weixin  
  // #endif  
  // #ifdef H5  
  div h5 web  
  // #endif  
</template>

  • 1***@qq.com (作者)

    好的,已经使用上了,谢谢

    2024-01-22 10:02

要回复问题请先登录注册