The first day vue entry: v-on use

v-on use

Summary:

v-on event is a binding mechanism, it can be abbreviated as @

Such as:

<input type="button" value="按钮" v-on:click="show">
<input type="button" value="按钮" @click="show">
<input type="button" value="按钮" v-on:mouseover="show">
 

js:

export default {
  methods: {
    show () {
      alert ( 'This is a pop')
    }
  }
}
Time during the event will trigger event

Guess you like

Origin www.cnblogs.com/guomouren/p/12627402.html