How to use the Datatimepicker using the Minit UI for mobile phone-side DateTimePicker
First of all, it needs two triggers here because the project uses the start-to-finish time, I manually passed in a parameter when I clicked.
And declare this method in the methods of Vue.
Openpicker (type) { this.type=type; this. $refs. Picker.open (); },
Here I accept the arguments passed at the time of the click to determine whether I clicked the start or end, and then click OK to trigger an event handleconfirm
Handleconfirm (data) {Let date = Moment (data). Format (' Yyyy-mm-dd '); if (this.type== ' start ') { this.starttime = date; } if (This.type = = ' End ') { this.endtime = date; } }
Click OK and then I will pass the clicked content to input in the time must be formatted, because the unit lets wear the format is YYYY-MM-DD so we have to format the parameters of the
It is recommended to use Moment.js
Import moment from ' moment '
The corresponding document address is http://momentjs.cn/docs/so that you can add to the parameters of the time we want in our advance input tag the option to complement the component
<mt-datetime-picker v-model= "pickervisible" type= "date" ref= "picker" year-format= "{value} Year " month-format=" {value} month " date-format=" {value} day " @confirm =" Handleconfirm " : StartDate = ' Maxdata ' : endDate = ' mindata ' > </mt-datetime-picker>
For friends who don't use Vue, I recommend a very good jquery plugin for a mobile phone.
Link: Https://pan.baidu.com/s/1pLyuN6F Password: yoq5
Understand JS to enter the Date.js can adjust its options like Minit UI style
Mint UI DateTimePicker Mobile-side jquery DateTimePicker Summary Application