鍍金池/ 問答/HTML/ element $msgbox render的checkbox不能雙向綁定數(shù)據(jù)

element $msgbox render的checkbox不能雙向綁定數(shù)據(jù)

clipboard.png

clipboard.png

問題描述

在on change回調(diào)中不能再次改變value的值

問題出現(xiàn)的環(huán)境背景及自己嘗試過哪些方法

相關代碼

// 請把代碼文本粘貼到下方(請勿用圖片代替代碼)
data() {

        return {
            isChecked: false
        }
    },

const h = this.$createElement;

            const _this = this;
            this.$msgbox({
                title: '提示',
                message: h('div', null, [
                    h('p', null, '已將當前房源分配到 “長租整租房源” 中您可前往繼續(xù)編輯房源詳情'),
                    h('ElCheckbox', {
                        props: {
                            value: _this.isChecked
                        },
                        on: {
                            change(val) {
                                _this.isChecked = val;
                            }
                        }
                    }, '不再提示'),
                ]),
                type: 'success',
                showCancelButton: true,
                confirmButtonText: '確定',
                cancelButtonText: '取消',
            }).then(res => {
                // console.log(res);
            }).catch(err => {

            });

你期待的結(jié)果是什么?實際看到的錯誤信息又是什么?

回答
編輯回答
舊螢火

換成dialog

2017年10月21日 06:16
編輯回答
孤慣
props: {
    checked: _this.isChecked
},
2017年6月14日 19:46