So as to add strategies to a element occasion we use the strategies
choice.
we will outline them the way in which we outlined knowledge
and certainly strategies
is a object of features.
const app = Vue.createApp({
knowledge() {
return {
depend: 0
}
},
strategies: {
increment() {
this.depend++
}
},
)}
Occasion and key Modifiers:
It’s a quite common must name one thing like occasion.preventDefault() inside occasion handlers. it may be achieved in methodology itself however there are some modifiers to use them simpler.
examples:
@click on.proper
@click on.stop.cease
@keyup.13
<!-- the submit occasion will now not reload the web page -->
<type @submit.stop="onSubmit"></type>
<!-- solely name `submit` when the `key` is `Enter` -->
<enter @keyup.enter="submit" />
would you like extra test right here
Run and edit them your self right here