<el-button type="text" @click="open4">点击打开 Message Box</el-button>
methods: {
        open4() {
        const h = this.$createElement;
        const aTemp = 'https://www.baidu.com/?tn=98010089_dg&ch=8';
        this.$msgbox({
            title: '消息',
            message: h('p', null, [
                h('span', null, '内容可以是 '),
                h('a', {
                    //普通html特性
                    attrs: {
                        href:aTemp
                    },
                    //相当于`v-bind:style`
                    style: {
                        color: 'red',
                        fontSize: '14px'},
                    },
                    '百度'
                )
            ]),
            showCancelButton: true,
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            beforeClose: (action, instance, done) => {
                if (action === 'confirm') {
                    instance.confirmButtonLoading = true;
                    instance.confirmButtonText = '执行中...';
                    setTimeout(() => {
                        done();
                        setTimeout(() => {
                        instance.confirmButtonLoading = false;
                        }, 300);
                    }, 3000);
                } else {
                    done();
                }
            }
        }).then(action => {
            alert('>>>>>');
            this.$message({
                type: 'info',
                message: 'action: ' + action
            });
        });
    }
},

$createElement实现自定义弹窗

 

来源 https://www.cnblogs.com/websmile/p/9167913.html

相关文章:

  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-02-07
  • 2021-12-29
  • 2020-10-25
  • 2021-11-03
猜你喜欢
  • 2018-08-08
  • 2022-12-23
  • 2023-02-07
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案