vue @input和@click的区别

版权声明:未经本人同意不得私自转载 https://blog.csdn.net/qq_40190624/article/details/85787903

@input 一般用于监听事件

只要输入的值变化了就会触发input

   <input 
        :type="type" 
        :value="value" 
        :placeholder="placeholder" 
        :name="name" 
        @input="$emit('input',$event.target.value)"
    />

@click 事件触发事件

        <input type="text" @click="clickFn">

猜你喜欢

转载自blog.csdn.net/qq_40190624/article/details/85787903