# MMEmpty 空状态
# Props
# IMMEmptyProps
属性 | 类型 | 默认值 | 必传 | 说明 |
---|---|---|---|---|
type | EMMEmpty | keyof typeof EMMEmpty | 否 | 快捷类型 | |
text | string | 否 | 文本 | |
src | string | 否 | 图片地址 | |
fixed | boolean | 否 | 浮动居中 | |
suffix | ReactNode | 否 | 后面需要添加的元素 | |
imgStyle | CSSProperties | 否 | 图片样式 | |
onClick | () => void | 否 | 点击 |
# 代码示例
import Taro from "@tarojs/taro";
import { FC, memo } from "react";
import { View } from "@tarojs/components";
import styles from "./index.module.less";
import MMNavigation from "@wmeimob/taro-design/src/components/navigation";
import MMEmpty from "../../components/empty";
import { EMMEmpty } from "../../components/empty/const";
interface IEmptyProps {}
const Component: FC<IEmptyProps> = () => {
return (
<View className={styles.emptyStyle}>
<MMNavigation title="empty" />
<MMEmpty type={EMMEmpty.contacts} text="空页面" />
<MMEmpty fixed text="浮动居中空状态(rn不支持)" />
</View>
);
};
const Empty = memo(Component);
export default Empty;