关于className

来源:6-2 基础架构 - Menu组件编码第一部分

寂寞追不上我

2020-04-20

蟀七的老师,请问,antd那种antd-xxx的类名是开发的时候手写的呢,还是打包时通过loader加的,非常感谢!

写回答

1回答

张轩

2020-04-21

你好欧 都是手写的 请看如下代码

const classes = classNames(prefixCls, className, {
[`${prefixCls}-${type}`]: type,
[`${prefixCls}-${shape}`]: shape,
[`${prefixCls}-${sizeCls}`]: sizeCls,
[`${prefixCls}-icon-only`]: !children && children !== 0 && iconType,
[`${prefixCls}-loading`]: !!loading,
[`${prefixCls}-background-ghost`]: ghost,
[`${prefixCls}-two-chinese-chars`]: hasTwoCNChar && autoInsertSpace,
[`${prefixCls}-block`]: block,
});


0
0

React18+TS高仿AntD从零到一打造组件库

设计,开发,测试,发布再到 CI/CD,从0到1造轮子

2124 学习 · 959 问题

查看课程