I need to do an action when Click Button (X) on search is clicked using Vue.
Include all the information someone would need to answer your question
new Vue({ el: "#app", data: { msg: 'the input is cleaned', info:'' }, methods: { handleClick: function(){ // to do sonthing when is cleaned not before if(this.info=='') alert(this.msg) }, } }) <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script> <div id="app"> <input type="search" v-model="info" @click="handleClick" > <br> <span></span> </div>
没有评论:
发表评论