0👍
✅
Thanks everyone for helping me, I have found a way for me to interact from one component to another which is using a bus event vuejs.
https://alligator.io/vuejs/global-event-bus/
0👍
You can separate 1st sidebar to external component and 2nd to another. Then include both components to your sidebar block and hide/show them whenever you want.
<sidebar>
<first-sidebar :trigger="boolean"></first-sidebar>
<second-sidebar :trigger="boolean"></second-sidebar>
</sidebar>
Then in your first sidebar component
<template>
<div v-if="trigger">
<!-- ... -->
</div>
</template>
<script>
export default {
props: ['trigger']
}
</script>
And finally second sidebar component
<template>
<div v-if="!trigger">
<!-- ... -->
</div>
</template>
<script>
export default {
props: ['trigger']
}
</script>
Source:stackexchange.com