Home > Web Front-end > JS Tutorial > body text

Vue implements click time to obtain time period query (with code)

php中世界最好的语言
Release: 2018-05-15 10:20:43
Original
3302 people have browsed it

This time I will bring you Vue to implement click time to obtain time period query (with code). What are the precautions for Vue to implement click time to obtain time period query. The following is a practical case, let’s take a look. one time.

The example of this article shares with you the case of vue query by time period. The rendering is as follows

Vue implements click time to obtain time period query (with code)

html code

<template>
<p>
   <input>
   </p>
<p></p>
   <input>
  
  <ul>
   <li>今天</li>
   <li>昨天</li>
   <li>本周</li>
   <li>上周</li>
   <li>本月</li>
   <li>上月</li>
  </ul>
  <p>
   <button>查询</button>
  </p>
  </template>
Copy after login

vue.js Code click event

//获取时间、
//时间解析;
  Time:function(now)  {
  let year=new Date(now).getFullYear();
  let month=new Date(now).getMonth()+1;
  let date=new Date(now).getDate();
  if (month <p> I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website! </p><p>Recommended reading: </p><p style="text-align: left;"><a href="http://www.php.cn/js-tutorial-396234.html" target="_blank">Detailed explanation of the steps to implement dynamic and static paging in layui</a><br></p><p style="text-align: left;"><a href="http://www.php.cn/js-tutorial-396230.html" target="_blank">Detailed explanation of Vue component use cases</a><br></p><p style="text-align: left;"><a href="http://www.php.cn/js-tutorial-396226.html" target="_blank">Vue implementation of PopupWindow component usage steps analysis</a><br></p>
Copy after login

The above is the detailed content of Vue implements click time to obtain time period query (with code). 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template