Sunday, October 30, 2022
HomeWordPress DevelopmentVueJs Learners half 2 - Strategies

VueJs Learners half 2 – Strategies


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++
    }
  },
)}
Enter fullscreen mode

Exit fullscreen mode

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" />
Enter fullscreen mode

Exit fullscreen mode

would you like extra test right here

Run and edit them your self right here

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments