• 封装: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
  • 相关阅读:
    大数据技术之Kafka是什么
    大数据技术之Hadoop 基础认识
    在eclipse中运行Mapreduce & spark
    datatstage 中一直处于Ready 状态
    Datastage run 有时候太慢 有时候performance 还Okay
    不能重复造轮子,尤其是枯燥的轮子,要造就造有趣的、好玩的轮子
    什么是好?什么是优秀?
    字面量-上集
    图片切换-vue
    数据绑定
  • 原文地址:https://www.cnblogs.com/sunny3158/p/16126635.html
Copyright © 2020-2023  润新知