搭建vue项目以及初始化步骤

搭建vue项目步骤

搭建Vue项目步骤如下:
①、打开cmd,cd到项目存放路径如:

cd C:\Users\lenovo\Desktop\bus_total

②、全局安装 vue-cli,cmd里输入命令行:

npm install -g vue-cli

③、创建一个基于 webpack 模板的新项目,在项目所在文件夹下,先进行初始化,即当前目录输入:

vue init webpack

根据提示,进行YES/NO,即安装是否安装配置路由之类的。

? Generate project in current directory? Yes
? Project name bus_total
? Project description A Vue.js project
? Author 王利平 <6551469+wang_li_pingping@user.noreply.gitee.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests No
? Setup e2e tests with Nightwatch? Yes
? Should we run `npm install` for you after the project has been created? (recommended) npm

④、新建目录:vue init webpack my-project。(该步骤与第3步骤一样,选一即可)
⑤、安装依赖,进入项目所在文件夹,即当前文件夹、输入:

npm install

⑥、启动项目

npm run dev

⑦在浏览器中输入:

http://localhost:8080/

能看到:Welcome to Your Vue.js App页面则表示成功。

猜你喜欢

转载自blog.csdn.net/qq_41497443/article/details/107360477