mp-colorui
Version:
MP ColorUI 是一款基于 Taro 框架并且联合 Color-UI CSS 库开发的多端 UI 组件库(目前仅支持小程序端)
21 lines (19 loc) • 641 B
JavaScript
import Taro from "@tarojs/taro-h5";
import Nerv from "nervjs";
import { View } from '@tarojs/components';
import { BG_COLOR_LIST } from "../utils/model";
export default class ClCard extends Taro.Component {
render() {
const props = this.props;
const typeClassName = props.type === 'full' ? 'no-card' : '';
const colorClassName = props.bgColor ? BG_COLOR_LIST[props.bgColor] : 'bg-white';
return <View className={`cu-card case ${typeClassName}`}>
<View className={`cu-item shadow padding ${colorClassName}`}>
{this.props.children}
</View>
</View>;
}
}
ClCard.options = {
addGlobalClass: true
};