1.0.0 • Published 3 years ago

xueyao v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
3 years ago

install

use npm: npm i --save xueyao
use yarn: yarn add xueyao
const El = (props) => {
  return <div className="dd">{props.name}</div>;
};

Modal.show({
  title: "弹窗",
  mask: true,
  footer: true,
  cancelText: "Cancel",
  okText: "OK",
  content: <El name="xueyao" />,
  onClose: () => {
    Modal.hide();
  },
  onOk: () => {},
});

show 函数中的参数: | 属性 | 说明 | 参数 | 默认值 | 类型 | | ----- | -------- | ---- | -------- | -----| | title | 弹窗标题 | 无 | '弹窗' | String| |mask | 是否显示遮罩|无| true|Boolean| |width|弹窗长度|无|700|Number or String| |height|弹窗高度|无|400|Number or String| |content | 显示的主体内容 | 无 | Modal...| ReactNode or String| |onClose | 点击关闭弹窗或取消按钮 | 无 | Modal.hide| Function| |onOk | 点击确认按钮 | 无 | Modal.hide| Function| |footer|是否显示底部按钮|无|true|Boolean| |cancelText|取消按钮文案|无|取消|String| |okText|确定按钮文案|无|确定|String|

hide 函数: 关闭弹窗 如果自定义关闭按钮或者自定义确认按钮异步交互后请使用此函数关闭弹窗

注: width/height 为 Number 类型时: 默认单位是 px;如果为 String 类型,请自行添加参数,也可自行设置百分比等等

1.0.0

3 years ago