=======ggcss样式========
:root{
    --bgColor : #d3252a;
    --pinkColor : #ff4e81;
    --textColor : #d3252a;
    --selectdBg:#823d3e;
}
 
 
 
.colorRed{
    color: #f24646;
}
.colorBlue{
    color: #4e8eff;
}
.colorGreen{
    color: #37bc3e;
}
/* 93%居中 */
.widMargin{
    width: 100%;
}
.marginAuto{
    margin: 0 auto;
}
.marg93{
    width: 93%;
    margin: 0 auto;
}
/* 透明度 */
.opacinone{
    opacity: 0;
}
.disNone{
   display:none!important
}
/* 弹性盒 */
.flex-around{
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.flex-center{
    display: flex;
    justify-content: center;
    align-items: center;
}
.flex-left{
    display: flex;
    justify-content: left;
    align-items: center;
}
.flex-between{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.flex-between-top{
    display: flex;
    justify-content: space-between;
    align-items: top;
}
/* inputNone */
.inputNone{
    background: none;
    border: 0;
    outline: 0;
    color: #696969;
    font-size: 15px;
    text-indent: 10px;
    display: block;
    height: 38px;
}
.inputNone:focus{
    color: black;
}
/* 取消默认样式 */
img, span{
    display: block;
}
.borderNone{
    border: 0!important;
}
/* header+footer+body自适应 */
.AllPage{
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: absolute;
}
.ScrollContent{
    width: 100%;
    overflow:scroll;
    flex:10%;
}
/* button默认 */
button{
    border: 0;
    display: block;
    padding: 0;
}
/* 弹性盒,怪异盒模型盒阴影 */
.boxTurnStr{
    box-sizing: border-box;
}
.boxShado{
    box-shadow:#e8e0e0 0px 11px 6px -10px
}
/* 万恶的定位 */
.posiRelat{
    position: relative;
}
.posiAbsol{
    position: absolute;
}
.posiFixed{
    position: fixed;
}
/* input弹起软键盘改变样式 */
.inputKeyBordStyle{
    position: fixed;
    top: 0;
}
==========引入封装方法=========
// 处理时间相关
import timer from '../commonFunction/timer'
Vue.prototype.timer=timer

===========timer.js内部===========

export default{
    // 获取当前时间:20200424
    getNowTime(){
        let date = new Date();
        let seperator1 = "";
        // let seperator1 = "-";
        let year = date.getFullYear();
        let month = date.getMonth() + 1;
        let strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9){
            strDate = "0" + strDate;
        }
        return year + seperator1 + month + seperator1 + strDate;
    },
    // 时间戳转时间 2020-4-24 00:30:00
    timeStamp(val) {
      if(val.length == 10) {
        let time = val * 1000;
        let timestamp4 = new Date(time);
        return (timestamp4.toLocaleDateString().replace(/\//g, "-") +" " + timestamp4.toTimeString().substr(0, 8));
      } else {
        let timestamp4 = new Date(val);
        return (timestamp4.toLocaleDateString().replace(/\//g, "-") +" " +timestamp4.toTimeString().substr(0, 8));
      }
    },
    // 20200426=>2020-04-26
    insertStr(soure, start, newStr){   
        return soure.slice(0, start) + newStr + soure.slice(start);
    },
    getNowTime0(){
      let date = new Date();
      let seperator1 = "0";
      // let seperator1 = "-";
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      let strDate = date.getDate();
      if (month >= 1 && month <= 9) {
          month = "0" + month;
      }
      if (strDate >= 0 && strDate <= 9){
          strDate = "0" + strDate;
      }
      return year + seperator1 + month + seperator1 + strDate;
    },
    // 任意带'-'时间转四位带0月份
    handeldata(str){
      for(let i=0;i<str.length;i++){
          if(str.length==3){                 //1-1  0101  长度3
            return '0'+str[0]+'0'+str[2]
          }else if(str.length==4){           //1-23  0123和1203   长度4
            if(str[1]=='-'){
              return '0'+str[0]+str[2]+str[3]  //12-3  和1203   长度4
            }else if(str[2]=='-'){
              return str[0]+str[1]+'0'+str[2]
            }
          }else{                               //12-21
            return str[0]+str[1]+str[3]+str[4]
          }
        }
      },
      // 2017-4-8转2017-04-08 或者2010-7-24 2010-07-24
      handeldate(m){
        let o = m[0]+m[1]+m[2]+m[3]
        if(m.length==9){
            if(m[6]=='-'){
                return o+m[4]+'0'+m[5]+m[6]+m[7]+m[8]
            }
            if(m[7]=='-'){
                return o+m[4]+m[5]+m[6]+m[7]+'0'+m[8]
            }
        }else if(m.length==8){
            return o+m[4]+'0'+m[5]+m[6]+'0'+m[7]
        }else{
            return m
        }
    }
  }
使用:方法内:
this.timer.getNowTime()

vue-cli快速搭建项目的几个文件(二)的更多相关文章

  1. 基于Vue-cli 快速搭建项目

    Vue-cli可以快速帮助我们创建一个项目,这是官方给我们提供的脚手架.下面我说一下vue-cli的使用方法. 一.准备工作 在使用vue-cli时,首先需要安装nodejs,npm,其次需全局安装v ...

  2. vue-cli webpack 快速搭建项目

    一.安装vue npm install vue -g 二.用vue-cli快速搭建项目 //全局安装vue-cli npm install install -g vue-cli //创建一个基于web ...

  3. VUE CLI环境搭建文档

    VUE CLI环境搭建文档 1.安装Node.js 下载地址 https://nodejs.org/zh-cn/download/ 2.全局安装VUE CLI win+R键打开运行cmd窗口输入一下代 ...

  4. (转载) android快速搭建项目积累

    android快速搭建项目积累 2016-04-05 20:07 519人阅读 评论(0) 收藏 举报  分类: android优化(8)   Rx技术(5)  版权声明:本文为博主原创文章,未经博主 ...

  5. vue cli创建typescript项目

    使用最新的Vue CLI @vue/cli创建typescript项目,使用vue -V查看当前的vue cli版本 安装命令 npm install -g @vue-cli 创建项目 vue cre ...

  6. Vue CLI创建Vue2项目

    1.安装Node.js * Node.js中包含了npm工具 安装后查看版本: node -v npm -v 2.设置npm的源为国内源 npm config set registry https:/ ...

  7. vue cli3.0快速搭建项目详解(强烈推荐)

    这篇文章主要介绍下vue-cli3.0项目搭建,项目结构和配置等整理一下,分享给大家. 一.介绍 Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统.有三个组件: CLI:@vue/cl ...

  8. vue cli4.0 快速搭建项目详解

    搭建项目之前,请确认好你自己已经安装过node, npm, vue cli.没安装的可以参考下面的链接安装. 如何安装node? 安装好node默认已经安装好npm了,所以不用单独安装了. 如何安装v ...

  9. 使用Vue CLI脚手架搭建vue项目

    本次是使用@vue/cli 3.11.0版本搭建的vue项目 1. 首先确保自己的电脑上的Node.js的版本是8.9版本或者以上 2. 全局安装vue/cli npm install @vue/cl ...

  10. 使用vue-cli(vue脚手架)快速搭建项目

    vue-cli 是一个官方发布 vue.js 项目脚手架,使用 vue-cli 可以快速创建 vue 项目.这篇文章将会从实操的角度,介绍整个搭建的过程. 1. 避坑前言 其实这次使用vue-cli的 ...

随机推荐

  1. Python爬虫爬取ECVA论文标题作者摘要关键字等信息并存储到mysql数据库

    网站截图: 源代码: 1 import re 2 import requests 3 import pymysql 4 from bs4 import BeautifulSoup 5 import l ...

  2. HTTP长连接和短链接代理与网关

    长连接和短链接 代理与网关 HTTP/)服务器端网关:网关与客户端使用HTTP协议通信,使用其他协议与服务端通信 (/HTTP)客户端网关:网关与客户端使用其他协议通信,使用HTTP协议与服务端通信 ...

  3. #FFT#P4173 残缺的字符串

    题目 有一个长度为 \(m\) 的字符串 \(A\) 和 一个长度为 \(n\) 的字符串 \(B\), 它们有若干位置为通配符,现在问 \(B\) 的每一个后缀是否存在前缀为 \(A\). 分析 考 ...

  4. #矩阵乘法,线段树#CF575A Fibonotci

    题目 分析 \(K\)那么大肯定是矩阵乘法, 带修改可以用线段树单点修改, 转移矩阵类似于斐波那契数列, 这题思维难度不大,细节很多,需要很长时间QWQ 时间复杂度\(O(mlog_2K)\),具体注 ...

  5. #深搜,期望#CF105B Dark Assembly

    洛谷题目传送门 CODEFORCES传送门 分析 题目强调贿赂要在投票开始前完成说明分糖和成功率可以分开计算 那么分糖考虑直接暴搜,由于题目并没有说糖必须全部分完, 所以每一次分完一颗糖后均要求当前状 ...

  6. C 语言:类型转换与常量的细致理解

    C 语言中的类型转换 有时,您必须将一种数据类型的值转换为另一种类型.这称为类型转换 隐式转换 当您将一种类型的值分配给另一种类型的变量时,编译器会自动进行隐式转换. 例如,如果您将一个 int 值分 ...

  7. django admin后台自定义数据保存方式

    故事背景是这样的: 为了方便工作中数据的整理,需要开发一个 管理系统,用于记录一些事情. 该系统不需要精美的前端的页面,只需要使用django的admin后台管理就可以了. 我需要在添加数据的时候,把 ...

  8. CentOS SSH安装和配置

    CentOS SSH安装和配置 赞 0 CentOS  SSH  安装  配置  OpenSSH SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Worki ...

  9. 重新点亮shell————变量[三]

    前言 简单介绍一下shell的变量. 正文 变量的定义 变量名的命名规则 字母.数字.下划线 不以数字开头 变量的赋值 在赋值的时候不能出现空格 a =123,在等号前面有一个空格,那么会报错. 这是 ...

  10. 力扣183(MySQL)-从不订购的客户(简单)

    题目: 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: Orders 表:  解题思路: 需要查询出没 ...