乐趣区

classnames仅作为个人学习笔记

import cs from "classnames";

export class Card extends React.Component{render(){
    return (
    <>
    <Button classname={cs("foo","bar")}> 保存 </Button>
    <Button classname={cs("foo",{"bar":ture})}> 保存 </Button>
    <Button classname={cs("foo",{"bar":this.props.isBar})}> 保存 </Button>
     <Button classname={cs({[`${this.props.styles}`]:styles},
    {"bar":this.props.isBar})}> 保存 </Button>
     <Button classname={cs("foo",{"bar":this.props.isBar})}> 保存 </Button>
     <Button classname={cs(`this.state.visible ? styles.active : "",`}> 保存 </Button>
    </>
        
    )}
}

https://github.com/JedWatson/…

退出移动版