I have a div element below that changes its content based on the value of the variable 'fullSideBar', either true or false. Currently, this value is modified with a button click.
My question is whether it is possible to change the value of 'fullSideBar' when the screen width reaches a certain point. For example: @media screen and (max-width: 768px) { this.fullSideBar = false}.
Here is the code snippet:
<template>
<div>
<img
src="../../../static/icons/arrow-bar-left.svg"
alt="Left arrow icon"
class="pe-auto icon-SideBar"
@click="fullSideBar = !fullSideBar"
v-if="!this.fullSideBar"
>
<img
src="../../../static/icons/arrow-bar-right.svg"
alt="Right arrow icon"
class="pe-auto icon-SideBar"
@click="fullSideBar = !fullSideBar"
v-else
>
</div>
</template>
<script>
import FooterSideBarVue from './FooterSideBar.vue';
export default {
name: 'BodyScrolling',
components: {
FooterSideBarVue
},
data (){
return {
footerItems: [
'About'
, 'Documentation'
, 'Contact'
],
fullSideBar: false,
}
},
}
</script>
Is there a way to achieve this behavior?