fix(sidebar): dismissable property should still be reactive after mount
parent
8365a30f5b
commit
b10e2c5994
|
@ -52,6 +52,15 @@ export default {
|
|||
return {
|
||||
$parentInstance: this
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dismissable(newValue) {
|
||||
if (newValue) {
|
||||
this.bindOutsideClickListener();
|
||||
} else {
|
||||
this.unbindOutsideClickListener();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -119,4 +119,12 @@ describe('Sidebar.vue', () => {
|
|||
|
||||
expect(wrapper.vm.containerVisible).toBeFalsy();
|
||||
});
|
||||
|
||||
it('When component is mounted , dismissable property should still be reactive', async () => {
|
||||
await wrapper.setProps({ dismissable: false, visible: true });
|
||||
|
||||
await wrapper.setProps({ dismissable: true });
|
||||
|
||||
expect(wrapper.vm.containerVisible).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue