Merge pull request #5568 from XavierChevalier/fix/sidebar-reactive-dismissable-property
fix(sidebar): dismissable property should still be reactive after mountpull/5630/head
commit
4ed80b33ff
|
@ -52,6 +52,15 @@ export default {
|
||||||
return {
|
return {
|
||||||
$parentInstance: this
|
$parentInstance: this
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
|
watch: {
|
||||||
|
dismissable(newValue) {
|
||||||
|
if (newValue) {
|
||||||
|
this.bindOutsideClickListener();
|
||||||
|
} else {
|
||||||
|
this.unbindOutsideClickListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -119,4 +119,12 @@ describe('Sidebar.vue', () => {
|
||||||
|
|
||||||
expect(wrapper.vm.containerVisible).toBeFalsy();
|
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