• 封装:elementui之confirm消息提示框、确认提示弹框


    封装:element-ui之confirm消息提示框、确认提示弹框

    src/utils/index.js

    1. /**
    2. * @author 封装 element-ui confirm
    3. * @param text
    4. * @param title
    5. * @param config
    6. * @returns {Promise}
    7. */
    8. export function confirm(text, title = '温磬提示', config = {}) {
    9. return new Promise((resolve, reject) => {
    10. let confirmButtonLoadingClose = () => {
    11. }
    12. let _config = merge({
    13. showCancelButton: true,
    14. closeOnClickModal: false,
    15. center: true
    16. }, config)
    17. let afterCloseResolve = () => {
    18. }
    19. _config.beforeClose = (action, instance, done) => {
    20. if (lodash.isFunction(config.beforeClose)) {
    21. config.beforeClose(action, instance, () => {
    22. })
    23. }
    24. if (lodash.isFunction(config.confirmCallBack)) {
    25. if (action === 'confirm') {
    26. instance.confirmButtonLoading = true
    27. confirmButtonLoadingClose = () => {
    28. instance.confirmButtonLoading = false
    29. }
    30. config.confirmCallBack({
    31. confirmButtonLoadingClose,
    32. close: () => new Promise((resolve, reject) => {
    33. done()
    34. afterCloseResolve = resolve
    35. }),
    36. action
    37. })
    38. } else {
    39. done()
    40. }
    41. }
    42. if (!config.confirmButtonLoading) {
    43. done()
    44. }
    45. }
    46. delete _config.confirmButtonLoading
    47. MessageBox.confirm(text, title, _config).then(_ => {
    48. afterCloseResolve()
    49. resolve()
    50. }).catch(err => {
    51. afterCloseResolve()
    52. reject(err)
    53. })
    54. })
    55. }

    订单池: src/views/fhb/temporary/Index.vue

    提现审核:src/views/withdraw/index.vue

    import {copy, dotData, alert, confirm} from '@/utils'

    https://blog.csdn.net/qq_37126704/article/details/86701160
  • 相关阅读:
    控件显示和隐藏
    删除标题和边框
    界面图片
    VC界面最前端显示
    在VC++6.0开发中实现全屏显示
    VC比例放大缩小
    plsql dev
    通过OCCI连接oracle(C++)
    VC++使用Pro*CC++
    文件对话框
  • 原文地址:https://www.cnblogs.com/sunny3158/p/16126635.html
Copyright © 2020-2023  润新知