- 博客(7)
- 收藏
- 关注
原创 正则验证及转换
以下记录项目中,用过的关于正则验证和转换的方法,会继续补充。 车牌号验证: isVehicleNumber(value1,value2) { let vehicleNumber = value1+value2; var result = false; if (vehicleNumber.length == 7){ var express = /^[京津沪...
2020-01-13 10:17:55
650
原创 在vue中使用 js-cookie
原生封装cookie。 1、下载 npm install --save js-cookie 2、使用 import Cookies from "js-cookie"; const TokenKey = "userinfo_cookie"; // 获取token export function getToken() { return Cookies.get(TokenKey); } ...
2020-01-13 10:11:40
355
原创 vue 中 使用cookie(内附代码)
简单封装cookie,记录一下,以免忘记。 // 设置cookie export var setCookie = function (name, value, day) { if(day !== 0){ //当设置的时间等于0时,不设置expires属性,cookie在浏览器关闭后删除 var expires = day * 24 * 60 * 60 * 1000; ...
2020-01-13 10:10:09
269
原创 vue 路由守卫
router.beforeEach((to, from, next) => { let token = getToken(); // 获取token if (token != undefined) { // 如果存在token if (to.path === "/login") { next("/content/home...
2020-01-13 10:09:18
136
原创 veu 中 nprogress 的 使用方法
今天偶然发现一个进度条的轻量组件,之前再某个项目中见过,但不知道是上面组件,也没有深究,今天偶然看到,便试一下这个组件的用法并记录下来。 1、安装 npm install --save nprogress 2、引入 import Nprogress from 'nprogress' // js import 'nprogress/nprogress.css' // 样式 3、使用 我的后...
2020-01-13 10:07:49
397
原创 关于使用 百度地图 报 Cannot read property 'gc' of undefined 错误的问题
上周测试发现地图不显示,找了蛮久问题的没有找到,先将 可能报 Cannot read property ‘gc’ of undefined 错误的问题,归类。 1、没有创建地图容器。 <div id="fwzj_maps" class="tables" style="height:180px;"> 2、排除单词写错,代码写错的问题,有可能就是生命周期的问题 如果放在mounted里...
2020-01-13 10:01:36
1714
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅