=======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. vue3.0后多环境配置

    根目录下创建 .env 每个配置文件中都将包含此文件中的数据,类似于配置文件的全局 .env.development 默认开发环境 对应serve .env.production 默认生产环境 对应b ...

  2. vscode 屏蔽某些文件夹

    vscode 屏蔽某些文件夹 File--Preferences--Settings(Ctrl + ,) 搜索框里搜索 Files:Exclude 点击 Add Pattern ,如果想屏蔽掉所有 . ...

  3. C# 证件照替换底色、设置背景图

    软件说明 基于以下开源项目,做了再次封装 PaddleSegSharp: 本项目是一个基于百度飞桨PaddleSeg项目的人像分割模块而开发的.NET的工具类库.PaddleSeg是基于飞桨Paddl ...

  4. 我们正在被 DDoS 攻击,但是我们啥也不干,随便攻击...

    最近,一场激烈的攻防大战在网络世界悄然上演. 主角不是什么国家安全局或者黑客组织,而是一家名不见经传的创业公司--TablePlus. DDoS 攻击者们摩拳擦掌,跃跃欲试.他们从四面八方蜂拥而至,誓 ...

  5. 黄吉:如何适配OpenHarmony自有音频框架ADM?

    编者按:在 OpenHarmony 生态发展过程中,涌现了大批优秀的代码贡献者,本专题旨在表彰贡献.分享经验,文中内容来自嘉宾访谈,不代表 OpenHarmony 工作委员会观点. 黄吉 中国科学院软 ...

  6. VS的 x86_64 , x64_86 , x64 , x86 有什么区别

    x86 Native Tools Command Prompt - Sets the environment to use 32-bit, x86-native tools to build 32-b ...

  7. SQline安装

    SQLite 安装 SQLite 的一个重要的特性是零配置的,这意味着不需要复杂的安装或管理.本章将讲解 Windows.Linux 和 Mac OS X 上的安装设置. 在 Windows 上安装 ...

  8. HarmonyOS—UI 开发性能提升的推荐方法

    注:本文转载自 HarmonyOS 官网文档 开发者若使用低性能的代码实现功能场景可能不会影响应用的正常运行,但却会对应用的性能造成负面影响.本章节列举出了一些可提升性能的场景供开发者参考,以避免应用 ...

  9. HarmonyOS元服务开发实践:桌面卡片字典

     本文转载分享自华为开发者论坛<HarmonyOS元服务开发实践:桌面卡片字典>,作者:蛟龙腾飞   一.项目说明 1.DEMO创意为卡片字典. 2.不同卡片显示不同内容:微卡.小卡.中卡 ...

  10. Linux之sudo

    [摘要] 生产环境中为了系统的安全性,Linux主机的root权限是只能管理器使用,普通用户不具有root权限,但是可以通过sudo获取root权限执行一些操作. 一.知识要点 wheel组 在Lin ...