I am trying to toggle one element and, at the same time, bind styles to another element. I'm having trouble figuring out how to do this using @click
.
data(){
return {
show:false,
filterStyle: {
top: 0,
background: "#dfe4ea",
marginTop: "15px",
marginBottom: "15px",
},
}
}
methods: {
closing(){
this.show = !this.show
},
}
<p class="closeMap" @click="closing()">close</p>
Div for toggling below.
<div v-show="!show"></>
Div for applying styles below.
<div :style="filterStyle" class="filter"></div>
Can anyone help me understand how to achieve this?
Edit: Currently binding styles as shown above, but want to do it using @click
.