Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望vue版本支持SFC模板的条件编译 #11192

Open
nelk98 opened this issue Jan 25, 2022 · 1 comment
Open

希望vue版本支持SFC模板的条件编译 #11192

nelk98 opened this issue Jan 25, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@nelk98
Copy link

nelk98 commented Jan 25, 2022

这个特性解决了什么问题?

为了更方便的实现多平台的代码书写,在文档中找到了样式文件的条件编译语法,但是没有找到相关的模板条件编译语法,目前只能使用jsx实现多平台条件编译,或者能否告知有其他方法可以实现?

这个 API 长什么样?

<!-- #ifdef h5 -->
<view>这是只存在于h5平台的节点</view>
<!-- #endif -->

<!-- #ifndef h5 -->
<view>这是只存在于h5之外平台的节点</view>
<!-- #endif -->
@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Jan 25, 2022
@b2nil
Copy link
Collaborator

b2nil commented Jan 25, 2022

之前以另外一种形式实现了一个 SFC 模板条件编译插件的 POC: plugin-taro-env
好用的话,可以 PR 给 Taro,整合到 Taro,无需再单独安装插件。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants