如何用 v-on 监听多个方法
方法1:
javascript
<el-button type="success" v-on="{'contextmenu':box,'click':click}" round>成功按钮</el-button>
const box = () =>{
console.log(1111);
}
const click = ()=>{
console.log(2222);
}
方法2:
javascript
<button v-on:click="sayHello; sayGoodbye">Click me</button>
methods: {
sayHello: function() {
},
sayGoodbye: function() {
}
}
方法3:
javascript
<input v-on:input="a" v-on:blur="b" />
const a = () =>{
console.log(1111)
}
const b = () =>{
console.log(2222)
}
ヾ( ̄▽ ̄)Bye~Bye~