简体   繁体   中英

How to get value of input field on focus vuejs

I have a input field

<input @focus="showTimeAvailabilityModal(this)" class="form-control" v-model="date1" placeholder="First Date & Time Preference"/>

I called a function showTimeAvailabilityModal on focus of that input field. I need to get value of input field in this function. How can I do this in simplest way?

You can do this.

showTimeAvailabilityModal(){
var date =this.date1;
}

or try this

@focus="showTimeAvailabilityModal(date1)"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM