10.2 Vue 环境安装

 Vue 环境安装

环境准备 

nodejs 下载安装 

https://nodejs.org/en/

查看下载版本

C:\>node -v
v7.6.0
C:\>npm -v
4.1.2

下载引入 

vue.js 

https://vuejs.org/js/vue.js

npm

npm install vue

相关的命令 

npm init --yes   初始化项目 自动生成一个 package.json 文件
npm rebuild      拿到别人的项目环境不一致导致报错的时候可以先重建一下环境
npm install     下载所有的依赖包 
npm install jquery --save   下载依赖包
npm run build    打包生成静态文件夹
npm run dev    启动项目
npm start    启动项目


npm install -g cnpm --registry=https://registry.npm.taobao.org    更改为淘宝镜像
cnpm install -g vue-cli    安装 vue-cli 
vue -V   查看版本
vue list 查看项目支持类型

查看支持项目类型

简单示例用  webpack-simple

真正项目用  webpack

    C:\>vue list

      Available official templates:

      ★  browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.
      ★  browserify-simple - A simple Browserify + vueify setup for quick prototyping.
      ★  pwa - PWA template for vue-cli based on the webpack template
      ★  simple - The simplest possible Vue setup in a single HTML file
      ★  webpack - A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
      ★  webpack-simple - A simple Webpack + vue-loader setup for quick prototyping.

创建项目 

F:\yangtuo>vue init webpack

? Generate project in current directory? Yes
'git' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
? Project name yangtuo
? Project description A Vue.js project
? Author
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm

   vue-cli · Generated "yangtuo".


# Installing project dependencies ...

 

转载于:https://www.cnblogs.com/shijieli/p/10256915.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值