Merge pull request #5568 from XavierChevalier/fix/sidebar-reactive-dismissable-property

fix(sidebar): dismissable property should still be reactive after mount
pull/5630/head
Tuğçe Küçükoğlu 2024-04-19 14:46:01 +03:00 committed by GitHub
commit 4ed80b33ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View File

@ -52,6 +52,15 @@ export default {
return {
$parentInstance: this
};
},
watch: {
dismissable(newValue) {
if (newValue) {
this.bindOutsideClickListener();
} else {
this.unbindOutsideClickListener();
}
}
},
};
</script>

View File

@ -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();
});
});