VUEJS脚手架

Vue 安装
vue-cli /webpack 全局安装

全局webpack:
npm install webpack -g

vue脚手架vue-cli:
npm install vue-cli -g

安装webpack 版vue 项目
在指定的目录中打开命令窗口(编辑器中自带的命令窗口也可以)
vue init webpack myvuedemo
Project name (回车默认)

Project description (A Vue.js project) 回车默认 (也可以输入自己的描述)

Author 回车默认(自己的名字)

Vue build 默认选择 Runtime+Compiler


Install vue-router?Y 安装


Use ESLint to lint your code? Y (推荐使用,保持良好的代码编写规范)

pick an eslint preset. 默认 Standard

扫描二维码关注公众号,回复: 12339589 查看本文章

set up unit tests ? n (unit 测试,不需要)

setup e2e tests with Nightwatch?n (e2e 测试,不需要)

Should we run npm install for you after the project has been created? (recom
mended) npm (选用 npm )


安装完毕


目录结构

Vue 运行
运行命令
cd myvuedemo
npm run dev

运行成功

页面内容

Vue build 打包
打包命令
npm run build


打包后的目录结构

运行打包项目
需要开启服务运行
使用http-server 运行(如没有安装http-server的,使用node 全局安装 http-server 即可,npm install http-server -g)
cd dist
http-server

# 安装 Vue Cli

npm install -g @vue/cli

# 创建一个项目

vue create hello-world

# 创建完成后,可以通过命令打开图形化界面,如下图所示

vue ui

猜你喜欢

转载自blog.csdn.net/qq_39418742/article/details/102772409