I'm relatively new to working with vue.js and I have a small issue that I need help with.
Within my vue.js file, there is an existing method called doSomething()
:
doSomething(){
//updates few properties here
}
I also have a list or array as a computed property, let's call it pageUser(), and I want to trigger the doSomething()
method whenever pageUser.length == 0
.
How can this be achieved in vue.js? Is using v-if
in a tag a valid approach to invoke the method, or are there other methods to accomplish this?