ES6
es6 是新型的js规范,学习它可以大幅度加快我们的开发速度,如果你不学习es6,那么你就out啦 0.0,
es6语法
个人的一些总结:
- 函数(对象)表示方法:eg
functionName(){
//code
}
functionName:()=>{
}
functionName:(参数1,参数2)=>{
}
- 对象obj的表示方法:
{}
var routes=[
{path:,component:},
]
var router=new VueRouter({
routes//或者routes:routes,可以随便取名不管如何取名属性永远是后面那个
})
new Vue({
el:"#box",
router//router:router
})
只有对象才有属性和方法,所以点前面的一定是对象{},如a.b一定可以写成a={
b:xxx
}
- json的格式{}:
属性之间用,隔开;末尾不加任何符号