2.2.6 • Published 1 year ago

@plutojs/modal v2.2.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@plutojs/modal

基础模态框组件

页面组件引用

import React, { useState } from 'react';
import Modal from '@plutojs/modal';
import '@plutojs/modal/build/index.css';

const [isOpened, setIsOpened] = useState(false);

<Modal
  isOpened={isOpened}
  position="center"
  isMask={true}
  isLock={true}
  closeOnClickOverlay={true}
  onHide={() => { setIsOpened(false); }}>
  <div className="modal-demo-text">模态框内容</div>
</Modal>

代码动态引用

const { destroy } = Modal.popup({
  children: <div className="modal-demo-text">文字内容</div>,
  isOpened: true,
  position: 'center',
  isMask: true,
  isLock: true,
  closeOnClickOverlay; true,
  onHide: () => { destroy(); },
});
参数描述类型可选默认值
isOpened是否显示模态框Boolean
position模态框内容定位top/center/bottomcenter
isMask背景是否透明Booleantrue
isLock锁定页面滚动Booleantrue
closeOnClickOverlay点击背景关闭模态框Booleantrue
zIndex组件层级Number999
target模态框内可滚动区域的refRefObject
onHide关闭模态框方法Function
2.2.1

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.2.6

1 year ago

2.2.0

2 years ago

2.0.2

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.9

4 years ago

1.6.8

4 years ago

1.6.7

4 years ago

1.6.6

4 years ago

1.6.5

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago