使用全局樣式,這樣會比較方便嘁傀,樣式較多的情況下兴蒸。
自定義組件
import { View} from "@tarojs/components";
import Taro from "@tarojs/taro";
import Component = Taro.Component;
interface IProps {}
interface IState {}
export default class SexDetailItem extends Component<IProps, IState> {
static options = {
addGlobalClass: true
}
render() {
return <View>
<View className='remaining-seat at-row at-row__align--center'>
<View className='reamining-title at-col at-col-3' >余</View>
<View className='at-col at-col-3'>{2}</View>
</View>
</View>;
}
}
main.tsx
<View><SexDetailItem /></View>