完整的创建一个vue项目
前言
长时间没有做vue了,现在记录一下完整地创建一个vue项目的过程。
提示:以下是本篇文章正文内容,下面案例可供参考
一、先下载nodejs
链接:http://nodejs.cn/
下载这里不展开说了,就是安装加配置环境变量,本文主要围绕npm安装vue以及运行vue
二、使用步骤
1.安装vue脚手架
代码如下(示例):
npm install -g @vue/cli
2.检查是否引入成功
代码如下(示例):
Vue -V
返回示例
@vue/cli 5.0.4
3.开始创建项目
提示:项目名称不能有大写字母
代码如下(示例):
vue create “项目名称”
4.项目搭建完成
返回示例:
Vue CLI v5.0.4
? Please pick a preset: Default ([Vue 3] babel, eslint)
? Pick the package manager to use when installing dependencies: NPM
Vue CLI v5.0.4
✨ Creating project in C:\Users\1\chargingpile.
🗃 Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...
> yorkie@2.0.0 install C:\Users\1\chargingpile\node_modules\yorkie
> node bin/install.js
setting up Git hooks
done
> core-js@3.21.1 postinstall C:\Users\1\chargingpile\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
added 840 packages from 462 contributors and audited 841 packages in 33.178s
82 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
🚀 Invoking generators...
📦 Installing additional dependencies...
added 96 packages from 97 contributors and audited 937 packages in 8.415s
92 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
⚓ Running completion hooks...
📄 Generating README.md...
🎉 Successfully created project chargingpile.
👉 Get started with the following commands:
$ cd xxx
$ npm run serve
5.运行项目
代码如下(示例):
cd xxx //进入项目
npm run serve
总结
过程比较简单,就是简单的记录