环境配置和创建vue3项目
1.node版本要10以上
2.npm install -g @vue/cli
3.vue --version 查看版本号4.5.0以上
4.vue create vue3bases
5.第三项
6.第一个(choose Vue version),第二个(Babel),第三个(TypeScript),倒数第三个(Unit Testing)
7.n,,,,,n 全是默认+n
1.在vscode中安装eslint
如果eslint不生效,在项目的更目录新建一个.vscode的文件夹,里面setting.json {"eslint.validate":["typescript"]}
2.在vscode中安装vetur
vue3 的生命周期
new Vue ---> setup方法--->onBeforeMount------>onMounted------>onBeforeUpdated----->onUpdated---->onBeforeUnmount----->onUnmounted
调试用的:onRenderTracked,onRenderTriggered
安装axios :npm install axios --save