2021年1月4日星期一

how to make function when Click Button (X) on Input Field search vuejs

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>
https://stackoverflow.com/questions/65571912/how-to-make-function-when-click-button-x-on-input-field-search-vuejs January 05, 2021 at 09:07AM

没有评论:

发表评论