Answer the question
In order to leave comments, you need to log in
How to pass attribute value to Vue method?
There are three tabs, on hovering over one of them, the corresponding block should pop up. They should be connected by data-attr.
<template>
<li data-rel="ex-1" @click="expand">
<li data-rel="ex-2" @click="expand">
<li data-rel="ex-3" @click="expand">
<div v-show="isActive" :class="{ active: isActive }" data-rel="ex-1" @mouseleave="expand">
<div v-show="isActive" :class="{ active: isActive }" data-rel="ex-2" @mouseleave="expand">
<div v-show="isActive" :class="{ active: isActive }" data-rel="ex-3" @mouseleave="expand">
</template>
<script>
export default {
data() {
return {
isActive: false,
};
},
methods: {
expand() {
this.isActive = !this.isActive;
},
},
};
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question