Vue 3 is a progressive framework for web development, this opensource project is a power tool in web developer kit. It's fast, lightweight and easy to learn. Version 3 has many performance upgrade from Vue 2.

Handling the click

In the template (HTML) section of a Vue 3 component, we can easily integrate a handler using the @click directive.

The following example illustrate an increment count and it uses a Composition-API setup.

 <template> <div>  <button @click="{count++}"></button> <p> count : {{count}} </p> </div> </template>  <script> import { defineComponent, ref } from "vue";  export default defineComponent({   name:'Home',     setup() {     const count= ref(0);         return {      count     };   }, }); </script> 

Within a double mustache operator we can embed the reactive property.


This free site is ad-supported. Learn more