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

67 lines
1.1 KiB
JavaScript
Raw Normal View History

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