Nhận máy chủ Vue của riêng bạn
Ứng dụng.vue
main.js
 <template> <h1>v-on Example</h1> <p>The '.once' modifier prevents the event from happening more than once.</p> <button v-on:click.once="clickTimes++">Click</button> <p>Click event happened {{ clickTimes }} times.</p> </template> <script> export default { data() { return { clickTimes: 0 }; } } </script>
 import { createApp } from 'vue' import App from './App.vue' const app = createApp(App) app.mount('#app')
https://localhost:5173/