react/jsx中使用className引入多个类样式

使用字符串模板,样式间用空格隔开

import React from 'react'
import styles from './index.less'

const Demo = (props) => (
<div className={`${styles.a} ${styles.b}`}/>
)
posted @ 2020-12-07 16:07  会潮  阅读(2186)  评论(0)    收藏  举报