[Vuejs]-Vuejs How to use $emit function properly?

0👍

Instead of v-bind:onClickCollapse="onClickCollapse" you should use v-on:onClickCollapse. This is kind of easy to miss because you used the word ‘on’ in your event name – it might be clearer to remove that.

Also, to pass that true/false string you need to pass $event into your function call: v-on:onClickCollapse($event). To clean this up you should probably also pass true/false booleans rather than strings.

Leave a comment