Flip 反转
正面
背面
import { QRCode } from "taro-code";
import { Flip } from "@finalx/components";
interface IProps {}
export const Index: FC<IProps> = () => {
const flipModel = useState(false);
return (
<Flip
model={flipModel}
front={<Image mode='aspectFill' src='https://img.png' />}
back={<QRCode size={50} text={JSON.stringify({ type: 3, id: 1 })} foregroundColor='#132048' />}
/>
);
};
属性
属性名 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
front | ReactElement | - | 是 | 正面展示的元素 |
back | ReactElement | - | 是 | 背面展示的元素 |
model | [boolean, Function] | - | 是 | 状态数组, 为真时显示背面,反之显示正面 |
props | any | - | 否 | 透传到根组件的属性 |