样式条件编译是否生效 #18909
Unanswered
parkerisme
asked this question in
Q & A
样式条件编译是否生效
#18909
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
使用"@tarojs/plugin-framework-vue3": "4.0.8",使用命令打包:"lib": "taro build native-components --type h5",源码中长这样:<style scoped>
/* #ifdef android /
.android-specific {
color: #33b5e5;
}
/ #endif */
/* #ifdef harmony /
.harmony-specific {
color: #007dfe;
}
/ #endif */
/* #ifdef ios /
.ios-specific {
color: #34c759;
}
/ #endif */
/* #ifdef we /
.we-specific {
color: #07c160;
}
/ #endif */
/* #ifdef h5 /
.h5-specific {
color: #07c160;
}
/ #endif */
.title {
font-size: 16px;
font-weight: bold;
color: v-bind(platformColor);
}
</style>,
打包后:/* #ifdef android /
/ #endif /
/ #ifdef harmony /
/ #endif /
/ #ifdef ios /
/ #endif /
/ #ifdef we /
/ #endif /
/ #ifdef h5 /
.h5-specific[data-v-d5c492bc] {
color: #07c160;
}
/ #endif */
这个样式条件编译生效了吗?为什么会有空的ifdef
Beta Was this translation helpful? Give feedback.
All reactions