import {designComponent, getComponentCls, useStyles} from "@peryl/react-compose"; import './empty.scss'; import i18n from "../i18n"; export const Empty = designComponent({ name: 'empty', props: { height: { type: String, default: '36px' }, width: { type: String, default: '36px' }, label: { type: String }, noMatch: { type: Boolean }, noData: { type: Boolean }, }, slots: ['default'], setup({ props, slots }) { const styles = useStyles(() => ({ height: props.height, width: props.width, })); return () => (
{props.noData ? ( ) : ( )} {slots.default(props.label || (props.noMatch ? i18n.$it('base.noMatch').d('暂无匹配') : i18n.$it('base.noData').d('暂无数据')))}
); }, }); export default Empty;