React的事件处理需要传一个函数名或者函数定义
而VueJS有3种情况都是允许的
直接传js代码
<div id="example-1"><button v-on:click="counter += 1">Add 1</button><p>The button above has been clicked {{ counter }} times.</p></div>
传函数名
<div id="event-with-method"><!-- `greet` 是在下面定义的方法名 --><button @click="greet">Greet</button></div>
传函数调用
<div id="inline-handler"><button @click="say('hi')">Say hi</button><button @click="say('what')">Say what</button></div>
而在vue中传函数定义是无效的,比如
<input type="text":value="register.username"@input="() => {register.username=$event.target.value}"placeholder="用户名">
