当vue的data里边声明或者已经赋值过的对象或者数组(数组里边的值是对象)时,向对象中添加新的属性,如果更新此属性的值,是不会更新视图的。
以下代码虽然没有指定类型,但是会在编译的时候报错:
1 | let myFavoriteNumber = 'seven'; |
事实上,它等价于:
1 | let myFavoriteNumber: string = 'seven'; |
1 | let isDone: boolean = false; |
1.下载node.js http://nodejs.cn/download/ 推荐下载长期支持的版本
2.下载cnpm https://jingyan.baidu.com/article/9080802239521cfd90c80f55.html
1.运行 cnpm install -g create-react-app
2.create-react-app todolist(文件名)
3.cd todolist(进入项目文件)
4.npm run start(启动项目)
Update your browser to view this website correctly. Update my browser now