ES6模块之export和import详解

摘要: 文章转载自:https://blog.csdn.net/qq_28506819/article/details/75733601 ES6中的模块即使一个包含JS代码的文件,在这个模块中所有的变量都是对其他模块不可见的,除非我们导出它。ES6的模块系统大致分为导出(export)和导入(import) 阅读全文
posted @ 2018-04-19 14:31 tarrying 阅读(507) 评论(0) 推荐(0)

js 日期格式化函数

摘要: export function formatDate(date, fmt) { if (/(y+)/.test(fmt)) { // RegExp.$1匹配的值 fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); } let o = { '... 阅读全文
posted @ 2018-04-19 14:25 tarrying 阅读(131) 评论(0) 推荐(0)

vue2 阻止时间冒泡

摘要: click.stop.prevent 阅读全文
posted @ 2018-04-13 17:12 tarrying 阅读(257) 评论(0) 推荐(0)

vue1 到 vue2 v-el变成ref

摘要: vue1的写法 vue2的写法 阅读全文
posted @ 2018-04-09 17:57 tarrying 阅读(314) 评论(0) 推荐(0)

清除浮动

摘要: .clearfix display: inline-block &:after display: block content: "." height: 0 line-height: 0 clear: both visibility: hidden 参考http://www.daqianduan.co 阅读全文
posted @ 2018-03-30 15:32 tarrying 阅读(96) 评论(0) 推荐(0)

使用图片做背景使用滤镜做模糊处理

摘要: 首先在整块区域(.head)下设置position: relatvie;backgroud:rgba(7,17,27,0.498039);这里这是background是为在图片上设置一个背景颜色 然后在专门放背景图片的块区设置样式 .background position: absolute top 阅读全文
posted @ 2018-03-30 14:11 tarrying 阅读(308) 评论(0) 推荐(0)

vue-router配置

摘要: vue自动生成了路由选中的class,比如 我们想给router-link-active这个class换个名称:active let router = new VueRouter( {linkActiveClass: 'active', routes: routes} ); 这样写即可 参考api: 阅读全文
posted @ 2018-03-29 15:47 tarrying 阅读(124) 评论(0) 推荐(0)

vue-router 设置默认路由

摘要: 加入 {path: '/', redirect: 'ratings'},vue 1.0版本版本使用go,但是在2.0中是用router.go(‘/ratings’);会一直刷新 阅读全文
posted @ 2018-03-29 15:26 tarrying 阅读(13488) 评论(0) 推荐(0)

vue <router-view>没有渲染

摘要: 将routes中的components换成component 阅读全文
posted @ 2018-03-29 15:14 tarrying 阅读(367) 评论(0) 推荐(0)

JavaScript中七种函数调用方式及对应 this 的含义

摘要: http://blog.sina.com.cn/s/blog_621f1e120100rj21.htmlthis 在 JavaScript 开发中占有相当重要的地位,不过很多人对this这个东西都感觉到琢磨不透。要真正理解JavaScript的函数机制,就非常有必要搞清楚this到底是怎么回事。函数... 阅读全文
posted @ 2015-03-17 20:36 tarrying 阅读(199) 评论(0) 推荐(0)