[vue3]npm创建环境 安装vue-router yarn

1. npm安装 vue cli

[root@Python 20230401VUE3]# npm install -g @vue/cli

2. 查看 vue版本

[root@Python 20230401VUE3]# vue --version
@vue/cli 5.0.8

3. 创建项目

[root@Python 20230401VUE3]# vue create hello-world

4. 执行项目

 $ cd hello-world
 $ npm run serve

  App running at:
  - Local:   http://localhost:8080/ 
  - Network: http://10.105.212.1:8080/

5. 安装vue-router -s 添加在本地项目中

[root@Python hello-world]# npm install vue-router@4 -s

6. 安装vuex

yarn add vuex@next --save

"dependencies": {
  "core-js": "^3.8.3",
  "vue": "^3.2.36",
  "vue-router": "^4.1.6",
  "vuex": "^4.0.2"
},

7. yarn 安装

npm install -g yarn 
posted @ 2023-04-01 11:50  LeoShi2020  阅读(133)  评论(0编辑  收藏  举报