ant-design-vue/components/modal/index.js

64 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-03-06 19:14:41 +08:00
import Modal from './Modal'
2018-03-06 22:53:32 +08:00
import modalConfirm from './confirm'
2018-03-06 19:14:41 +08:00
// export { ActionButtonProps } from './ActionButton'
// export { ModalProps, ModalFuncProps } from './Modal'
2018-03-06 22:53:32 +08:00
const info = function (props) {
2018-03-06 19:14:41 +08:00
const config = {
type: 'info',
iconType: 'info-circle',
okCancel: false,
...props,
}
2018-03-06 22:53:32 +08:00
return modalConfirm(config)
2018-03-06 19:14:41 +08:00
}
2018-03-06 22:53:32 +08:00
const success = function (props) {
2018-03-06 19:14:41 +08:00
const config = {
type: 'success',
iconType: 'check-circle',
okCancel: false,
...props,
}
2018-03-06 22:53:32 +08:00
return modalConfirm(config)
2018-03-06 19:14:41 +08:00
}
2018-03-06 22:53:32 +08:00
const error = function (props) {
2018-03-06 19:14:41 +08:00
const config = {
type: 'error',
iconType: 'cross-circle',
okCancel: false,
...props,
}
2018-03-06 22:53:32 +08:00
return modalConfirm(config)
2018-03-06 19:14:41 +08:00
}
2018-03-06 22:53:32 +08:00
const warning = function (props) {
2018-03-06 19:14:41 +08:00
const config = {
type: 'warning',
iconType: 'exclamation-circle',
okCancel: false,
...props,
}
2018-03-06 22:53:32 +08:00
return modalConfirm(config)
2018-03-06 19:14:41 +08:00
}
2018-03-06 22:53:32 +08:00
const warn = warning
2018-03-06 19:14:41 +08:00
2018-03-06 22:53:32 +08:00
const confirm = function (props) {
2018-03-06 19:14:41 +08:00
const config = {
type: 'confirm',
okCancel: true,
...props,
}
2018-03-06 22:53:32 +08:00
return modalConfirm(config)
}
2018-03-07 21:36:15 +08:00
Modal.info = info
Modal.success = success
Modal.error = error
Modal.warning = warning
Modal.warn = warn
Modal.confirm = confirm
2018-03-06 19:14:41 +08:00
export default Modal