
前端
桀呐!
这是简介
展开
-
解决vue中编程式路由往同一地址跳转时报错的情况 _@jie
问题如下图提示:解决方法:将以下代码写到router中的index.js中// 解决编程式路由往同一地址跳转时会报错的情况const originalPush = VueRouter.prototype.pushconst originalReplace = VueRouter.prototype.replace// pushVueRouter.prototype.push = function push (location, onResolve, onReject) { if (onRe原创 2021-12-31 15:51:14 · 649 阅读 · 1 评论 -
js判断字符串是否包含http _@jie
1:正则var str=new RegExp("http");str.test("httpadfsd");//test方法返回值为(true或者false)2:indexOf();var newStr=str.indexOf("http");if(newStr==0){ console.log("字符串是以http开头的!")}if(newStr==-1){ console.log("字符串不是以http开头的!")}...原创 2021-05-28 16:34:17 · 1355 阅读 · 0 评论 -
element-ui复选框,选中后修改样式 _@jie
需求:复选框选中后,颜色保持正常,禁止修改①先设置好’选中且禁用’样式效果:②改变默认样式代码如下:<template> <div class="agree"> <el-checkbox v-model="checked" disabled> <span style="color: #409eff">安全账号</span> </el-checkbox> </div></template&原创 2021-04-16 17:05:35 · 1742 阅读 · 0 评论 -
前端将时间格式‘2020-03-03T16:49:18.000+0000‘转化成正常格式‘2020-03-03 16:49:18‘ _@jie
直接在前端对于原来的时间格式进行工具类转化:function renderTime(date) { var dates = new Date(date).toJSON(); return new Date(+new Date(dates) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') }转换成功为:2020-03-03 16:49:18...原创 2021-03-03 16:53:17 · 5481 阅读 · 2 评论