=======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. R语言安装教程

    R 语言官方网站:The Comprehensive R Archive Network 官方镜像站列表:CRAN - Mirrors 一.官网下载R安装包 下载地址为:Index of /bin 进 ...

  2. vue-router动态注册

    来源 写路由时每新建一个路由都需要import一下或其他方式(如箭头函数import)很是麻烦,有麻烦就有需求,于是以下这篇文章就来了 吹水 要想动态注册路由,那么就需要制定规则,即每个路由有一定的规 ...

  3. KingbaseES V8R6集群运维系列 -- connect_check_type参数

    案例说明: 在KingbaseES V8R6C7的版本中,repmgr.conf增加了connect_check_type参数可以指定参数值,默认值是'mix',以前版本为隐藏参数,默认值'ping' ...

  4. KingbaseES V8R6集群运维案例之---securecmdd工具usePAM配置

    案例说明: 默认在部署securecmdd工具后,在配置文件securecmdd_config中配置参数usePAM=yes,在有的系统主机环境,会导致securecmd客户端连接失败. 适用版本: ...

  5. KingbaseES 的oracle兼容性参数

    KingbaseES用户可通过设置相关的数据库兼容参数,部分或全部启用Oracle兼容特性. 常用的兼容性参数有以下这些: 参数名称 参数说明 ora_forbid_func_polymorphism ...

  6. archlinux调整分区及ext4文件系统大小

    参照 https://wiki.archlinuxcn.org/wiki/Parted 1.防止数据丢失 有重要数据的话先备份,防止系统崩了数据没了 可以的话先在虚拟机练习一下 2.注意点 修改分区的 ...

  7. Django实现WebSocket在线聊天室(channels库)

    1.Django实现WebSocket在线聊天室 1.1 安装channels pip install channels==2.3 (saas) F:\Desktop\Python_Study\CHS ...

  8. #博弈论#Poj 2505 A multiplication game

    题目 给你一个整数\(n\),你从1开始乘,乘2-9之间的任意一个数. 最先得到大于等于\(n\)的数的人胜利.Stan先手Ollie后手. 那么,请问给你一个数\(n\),Stan和Ollie都足够 ...

  9. #点分治#洛谷 4149 [IOI2011]Race

    题目 给一棵树,每条边有权.求一条简单路径,权值和等于 \(k\),且边的数量最小. 分析 点分治,记录一定权值的最小边数量, 每遍历一棵子树后统计答案 代码 #include <cstdio& ...

  10. RPM打包教程

    一.rpm是什么 rpm是一种安装包的格式.就像在Windows系统上我们常见的安装包格式是exe和msi一样,在linux上常见的安装包格式是deb和rpm.一般在红帽系列的系统上,不支持deb,所 ...