vue.js - Difference from @click and v-on:click Vuejs -
the questions should enough clear :). can see use:
<button @click="function()">press</button>
someone use:
<button v-on:click="function()">press</button>
but difference between 2 (if exists)
there no difference between two, 1 shorthand second.
the v- prefix serves visual cue identifying vue-specific attributes in templates. useful when using vue.js apply dynamic behavior existing markup, can feel verbose used directives. @ same time, need v- prefix becomes less important when building spa vue.js manages every template.
<!-- full syntax --> <a v-on:click="dosomething"></a> <!-- shorthand --> <a @click="dosomething"></a>
source: official documentation.
Comments
Post a Comment