Home> Web Front-end> Vue.js> body text

How to set time format in vue.js

藏色散人
Release: 2020-12-18 09:30:18
Original
5998 people have browsed it

How to set the time format in vue.js: First create a new Vue sample file; then format the date by using a custom time filter. The code is such as "filters:{shijianfilter:function(value ,args){...}".

How to set time format in vue.js

The operating environment of this tutorial: windows7 system, vue version 2.0. This method is suitable for all brands of computers.

Recommended related articles:vue.js

There is no formatting method for time in Vue.js. For example, create a new Vue file, and then output the current time on the page.

  
Copy after login

The results are as follows. This is obviously not the date format we see every day.

How to set time format in vue.js

At this time, you can format the date by using a custom time filter:

  
Copy after login

The output result at this time is

How to set time format in vue.js

The above is the detailed content of How to set time format in vue.js. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!