Home > front end >  Vue formatting time
Vue formatting time

Time:11-29

General can be divided into four steps
1: install the moment
 
NPM moment - I save
//it is to use NPM also can NPM for CNPM

Page 2: the need to format the time to introduce my moment
 
The import moment from "moment"

3: when calculating the properties of formatting
 
Filters: {
//attribute format method to calculate the data format for need time for formatting formatPattern expression
DataFilter (data, formatPattern) {
Return my moment (data). The format (formatPattern | | "MM - DD YYYY - HH: MM: ss")
}
}

4: call in HTML
 


  • Related