Deploy vue project

#1. First perform a global installation of vue

#安装vue脚手架
npm install -g vue-cli
#查看是否安装成功
vue list

Install vue scaffolding to create a project with vue

#webpack为文件名 fristvue为项目名
vue run webpack fristvue

If there is a connection timeout problem, execute it or if there is no response for a long time

npm i vue-cli -g
npm install -g webpack

Then execute the command to create the vue project

vue run webpack fristvue

If you can't download it, use offline installation.
You need to download vue-templates/webpack from the github repository or click the download link: https://pan.baidu.com/s/1qb2HDl2ZnMJkii_fz05jdQ
Extract code: a2e5, and then unzip it locally
to download the downloaded Throw the file to the .vue-templates directory in the user directory, change the name to webpack
and execute the offline installation command

vue init webpack firstvue  --offline

Download the project to your workspace and open it with the integrated terminal

#重新进行更新下包
npm install

run the project

npm run dev

Use git to upload the project to the gitee remote project repository
Execute the following information in the integrated terminal; the local must have a git environment

git init 
git add .   //添加文件到暂存区
git add README.md(如果项目中没有这个文件,会在后面几个操作中报错,解决方法是通过命令合并:git pull --rebase origin master)
git commit -m "first commit"
git remote add origin  [email protected]:xxx/xxx.git
git push -u origin master 

vue project integration element-UI
First create a new vue project

#新建一个vue-elementui的项目
vue init webpack vue-elemnet
#安装vue-router
npm install vue-router --save-dev
#安装element-ui
npm i element-ui -S
#安装SASS加载器(主要写css样式)
npm install [email protected] node-sass --save-dev
#进行安装相应的依赖包
npm install
#启动vue项目查看是否项目可以正常启动
npm run dev

2. The second way to create a vue project
2.1 Note: You must install vue3.0 or above before you can create it

#安装vue最新版本,若已安装旧版本则卸载旧版本重新安装新版本
npm install -g @vue/lic
#查看版本
vue -version

2.2 Create a vue project Create a vue project
in the project workspace

vue create wyydemo

If an error message appears, it means that the system prohibits the installation of unknown scripts

set-ExecutionPolicy RemotesSigned
#选择Y

Customize to select the desired configuration.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324353942&siteId=291194637