openkraken / kraken

A web standards-compliant, high-performance rendering engine based on Flutter.
https://openkraken.com
Apache License 2.0
4.93k stars 304 forks source link

支持className拼接CSS Module样式 #479

Open xmsz opened 3 years ago

xmsz commented 3 years ago

背景

// 不生效
<View className={`${styles.Item} ${value === EHomeSwitchTypes.ACCOUNT && styles.ItemChose}`}>
</View>

// 不生效
<View className={`${styles.Item}`}>
</View>

// 生效
<View className={styles.Item}>
</View>

需求

xmsz commented 3 years ago

这个影响还挺大了 相当于都不能

有没有人负责一下

xmsz commented 3 years ago

然后我进行了打印

正常web

a Switch--Switch--2hHzhLK b Switch--SwitchChecked--1tT6gil

Kraken

a [object Object] b [object Object]
{"position":"relative","width":"70rpx","height":"40rpx","borderRadius":"100rpx","background":"#eeecf2","transitionProperty":"width,height,top,bottom,left,right,backgroundColor,opacity,transform","transitionTimingFunction":"ease-in","transitionDuration":"300ms","transitionDelay":"0ms"}

说明CSS Module拼接的居然是实际的样式对象,和web表现不太一样 也就导致了拼接没有用