S
S
Spell282018-02-13 13:51:50
JavaScript
Spell28, 2018-02-13 13:51:50

Nuxt.js (Vue.js based) how to get the class of the element that called the function?

Nuxt.js how to get the class of the element that called the function?
I need to get the class of the element that calls the function:

<h1 class="title" v-bind:class="{ 'active': isVisible()}">

isVisible (className) {
    console.log(className)
}

Thanks in advance for any response.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Koch, 2018-02-13
@Spell28

Duplicate just the class into the passed function:

<h1 class="title" v-bind:class="{ 'active': isVisible('title')}">Test</h1>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question