使用antd的Modal组件进行信息提示,如果封装好的组件不能满足需求可以对组件的dom进行操作改变dom的结构,利用Modal.method()中封装的方法你能够容易操作dom结构
Modal.success
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| const modal = Modal.success({ content: '导出成功', iconType: ' ', width: 200, }) const btn = document.querySelector('.ant-confirm-btns') const btnParent = btn.parentNode btnParent.removeChild(btn) const modalMask = document.querySelector('.ant-modal-mask') const modalMaskParent = modalMask.parentNode modalMaskParent.removeChild(modalMask) const modalBody = document.querySelector('.ant-modal-body') modalBody.style.padding = '16px' setTimeout(() => modal.destroy(), 2000)
|