1.TypeError: Cannot read property 'setState' of undefined出錯的同學,請
```
onClick={this.click.bind(this)}
綁定了本身的this
```
需要加上bind(this)才可以使用、、
包括最后的this.clickHandle
2./* on + 方法名,最好用駝峰式*/
3.setState 一定是異步的,需要獲取或執行到修改之后的數據,需要callback 方可
```
onClick={this.click.bind(this)}
綁定了本身的this
```
需要加上bind(this)才可以使用、、
包括最后的this.clickHandle
2./* on + 方法名,最好用駝峰式*/
3.setState 一定是異步的,需要獲取或執行到修改之后的數據,需要callback 方可
2019-02-18
最贊回答 / 慕粉3824733
官網上有說(https://taro-ui.aotu.io/#/docs/quickstart):?引入h5配置?
h5: { ?esnextModules: ['taro-ui']}再引入所需要的組件?
import?'taro-ui/dist/style/index.scss'?//?全局引入一次即可就可以了
2019-02-01