fix: first trigger v-model change

pull/2682/head
tanjinzhou 2020-08-14 18:19:35 +08:00
parent 8907a9990c
commit d592854c73
4 changed files with 6 additions and 6 deletions

View File

@ -173,19 +173,19 @@ const Menu = {
this.$emit('click', e);
},
handleSelect(info) {
this.$emit('select', info);
this.$emit('update:selectedKeys', info.selectedKeys);
this.$emit('select', info);
this.$emit('selectChange', info.selectedKeys);
},
handleDeselect(info) {
this.$emit('deselect', info);
this.$emit('update:selectedKeys', info.selectedKeys);
this.$emit('deselect', info);
this.$emit('selectChange', info.selectedKeys);
},
handleOpenChange(openKeys) {
this.setOpenKeys(openKeys);
this.$emit('openChange', openKeys);
this.$emit('update:openKeys', openKeys);
this.$emit('openChange', openKeys);
},
setOpenKeys(openKeys) {
if (!hasProp(this, 'openKeys')) {

View File

@ -123,8 +123,8 @@ export default {
// static confirm: ModalFunc;
methods: {
handleCancel(e) {
this.$emit('cancel', e);
this.$emit('update:visible', false);
this.$emit('cancel', e);
this.$emit('change', false);
},

View File

@ -58,11 +58,11 @@ export default {
},
methods: {
setVisible(visible, e) {
this.$emit('update:visible', false);
this.$emit('close', e);
if (e.defaultPrevented) {
return;
}
this.$emit('update:visible', false);
if (!hasProp(this, 'visible')) {
this.setState({ _visible: visible });
}

View File

@ -169,8 +169,8 @@ const TimePicker = {
},
handleOpenClose({ open }) {
this.$emit('openChange', open);
this.$emit('update:open', open);
this.$emit('openChange', open);
},
focus() {