=======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. 【已失效】Xcode GUI 添加 SPM 依赖的时候访问不了 github,无视 git config proxy 配置解决方案

    此 openradar 中提出者指出了原因:Xcode 调用 libgit2 时传入了 GIT_PROXY_NONE,无视了 git config 中的 proxy 配置.作者说用了自己打的 libg ...

  2. LOTO示波器参加2023第101届中国(深圳)电子展

    西安乐拓精益信息科技有限公司,专注研发虚拟测量仪器,以虚拟示波器(USB示波器)以及相关衍生产品为主,包括信号发生器,逻辑分析仪等.乐拓科技以研发团队为核心,着力开发高性价比的示波器产品.无论您是资深 ...

  3. axios封装(处理token跟get中Content-Type的请求问题)

    axios封装 import axios from 'axios' //引入axios import store from '@/store/index' //引入store //此处引入router ...

  4. C# 单例模式使用 Singleton

    Singleton 类如下: public class Singleton<T> where T : class, new() { private static T _instance; ...

  5. KingbaseES 判断字符串包含的几种方法

    判断字符串包含的几种方法: 1. position test=# select position('aa' in 'abcd'); position ---------- 0 (1 行记录) test ...

  6. python 国家标准行业编码标准格式化处理

    代码在上次的基础上做了一点优化,之前对项目要的最终结果理解有些偏差: 原始数据的那一列行业编码是存在三位数和四位数的,我上次理解的三位数就是分割成两位数进行查找,其实三位数的编码是由于第一位的0没有显 ...

  7. 官宣!禅道与极狐(GitLab)达成深度合作,携手推进开源开放DevOps生态发展

    近日,禅道与著名编程开源开发平台极狐(GitLab)公司签署战略合作,双方将重点探索适用于中国用户DevOps全生命周期解决方案,并将在开源培训和教育.云服务解决方案等多个领域深度合作,共同助力国内D ...

  8. #状压dp#洛谷 3959 [NOIP2017 提高组] 宝藏

    题目 选定一个起点 \(S\),找到一棵生成树,最小化 \[\sum_{i=1}^n dep_i\times dis_i \] \(n\leq 12\) 分析 设 \(dp[d][S]\) 表示当前树 ...

  9. Git 删除 .gitignore 生成之前上传的文件

    清除缓存 git rm -r --cached . git add . 提交记录 git commit -m "chore: 清除缓存." git push

  10. nginx启用HTTP2特性

    本文于2017年2月底完成,发布在个人博客网站上. 考虑个人博客因某种原因无法修复,于是在博客园安家,之前发布的文章逐步搬迁过来. 查看当前nginx的编译选项 #./nginx -V nginx v ...