Difference between @click and v-on:click Vuejs

前端 未结 3 1446
时光说笑
时光说笑 2021-01-30 05:37

the questions should be enough clear :). But I can see that someone use:

Someone use:

3条回答
  •  囚心锁ツ
    2021-01-30 06:26

    There is no difference between the two, one is just a shorthand for the second.

    The v- prefix serves as a visual cue for identifying Vue-specific attributes in your templates. This is useful when you are using Vue.js to apply dynamic behavior to some existing markup, but can feel verbose for some frequently used directives. At the same time, the need for the v- prefix becomes less important when you are building an SPA where Vue.js manages every template.

    
    
    
    
    

    Source: official documentation.

提交回复
热议问题