- 博客(4)
- 收藏
- 关注
原创 简要归纳es6几个方法
eg1: 将arr1赋值arr2 es5做法,先做for循环把arr1遍历出来截止逐一push至arr2. es6做法,let arr2 = […arr1];eg2: for of 方法. es5做法,for循环 var x< xxx.length. es6 for(let val of arr)eg3: 拼接运算符.` es5做法,"xxxxx"+val+"xxxx...
2018-09-11 10:07:32
117
原创 结合demo浅谈vue路由实现原理
本文结合demo浅谈vue路由的实现方式. 更新视图但不请求页面是路由的核心需求,目前在浏览器实现主要有2种方式.利用URL中的hash值利用html5的history方法hash方法基本实现路由基本原理 URL中#及其后面的字符称之为hash,可通过window.location.hash属性读取hash虽然出现在URL中,但是不会被包括在http请求中,对服务端无效,因此...
2018-09-06 17:05:59
1142
原创 es6中 object.assign用法
object.assign的用法用于对象的合并,将源对象(source)的所有可枚举属性复制到目标对象(target)var target = { a: 1 };var source1 = { b: 2 };var source2 = { c: 3 };Object.assign(target, source1, source2);target // {a:1, b:2, c:3}...
2018-08-27 15:44:58
1046
原创 vue插件的使用
使用插件import Vue from 'vue'import wxsdk from '@/utils/jssdk-389'import shareImg from '@/assets/images/favicon.png';let img = new Image();img.src = shareImgexport default () => { Vue.use(w...
2018-08-27 14:58:51
195
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人