1.变量申明
const one = 1
let count = 0
2.模板字符串
const user = 'world'
console.log(hello ${user}) //hello world
3.箭头函数
4.对象字面量
app.model({ reducers:{
add(){
} // <=> add: function() {}
},
}) // 定义对象的方法时,可省略去function
5.扩充组件的props
const attrs = {
href : 'http://exm.org',
target:'_blank'
}
<a {...attrs}>hello
6.propTypes
function App (props){
return
{props.name}
}
App.propTypes = {
name:React.PropTypes.string.isRequired
}
7.Css Modules
.title {
color: red;
}
:global(.title) {
color: green;
}
//然后在引用的时候: