You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
背景:
因为Kraken暂不支持引入一些已有的第三方组件库
所以我们只能先自己造轮子
过程:
问题一:不支持CSS Module动态className
因为基本都用CSS Module
替代办法
问题二:transition动画需要设置默认状态
switch组件有个球不同状态会移动到不同位置,一般也是利用translate,但是注意的是Kraken里一定要有默认值,否则只有单向的动画
但问题还好办
问题三:background不支持transition动画
switch组件切换状态时,不仅球会位移,背景也会改变颜色,但是Kraken也还不支持background的动画
虽然也还是能想到一些奇淫巧技,例如背景用另外一个层进行显隐控制来实现,但是太麻烦了
还是希望赶紧先支持
问题四:不支持父子元素选择
这个就非常非常蛋疼了,因为几乎所有组件都会遇到多层级
如果不支持 那逻辑写起来就很麻烦
switch有两个动的,一个父背景颜色,一个子位移,那就得4种样式,className也要多拼几个样式很麻烦
持续更新中
Beta Was this translation helpful? Give feedback.
All reactions