How to get Class value in Vue Js?(how to bind it)


#1

when toggle open
class=" m-aside–offcanvas-default m-quick-sidebar–on">

when toggle close
class=" m-aside–offcanvas-default">

i need class value into my vueJs as per value change i get changed value how?

i want to get value when it’s change in my component and want to perform action on according…
how i can bind and when change action perform ??
any help

how to get value into my props of this class ?

props: ['myprop'],

watch: {
  myprop: {
    immediate: true, 
    handler (val, oldVal) {
      // do your stuff
    }
  }
}

#2

How are you changing class?


#3

You shouldn’t watch the DOM for changes, you should watch changes in your data. You should rethink your approach with this in mind.