【vue脚手架安装-@vue/vli】

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

vue脚手架安装-@vue/vli

全局安装create-react-app

npm i -g @vue/cli

下载慢切换至taobao镜像

使用nrm,nrm 是一个 npm 源管理器允许你快速地在 npm源间切换。
1.安装nrm
	npm i -g nrm
2.查看可选源 星号代表当前使用源
	nrm ls
3.切换至taobao镜像
	nrm use taobao
4.创建项目
	create-react-app myapp //myapp为自定义项目名称

创建项目

vue create 项目名
  1. Your connection to the default npm registry seems to be slow. Use https://registry.npm.taobao.org for faster installation? (Y/n) Y
  2. ? Please pick a preset:
    Default ([Vue 2] babel, eslint)
    Default (Vue 3 Preview) ([Vue 3] babel, eslint)
    > Manually select features
  3. ? Check the features needed for your project:
    ( ) Choose Vue version
    >() Babel //翻译工具, 将脚手架中时髦的ES6、ES7的新语法翻译为等效的ES5代码。让绝大多数浏览器都可以运行Vue脚手架代码.
    ( ) TypeScript
    ( ) Progressive Web App (PWA) Support
    (
    ) Router
    (*) Vuex
    ( ) CSS Pre-processors
    ( ) Linter / Formatter
    ( ) Unit Testing
    ( ) E2E Testing
  4. Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) n
    1). vue-router默认导航方式是hash方式 #/相对路径
    2). 如果改为history模式则地址栏中不包含#: /相对路径
    必须服务器端工程师提供首页重定向配置.
  5. Where do you prefer placing config for Babel, ESLint, etc.?
    In dedicated config files
    > In package.json
  6. Save this as a preset for future projects? (y/N) N
    等待…
    当看到Successfully created project 项目名说明生成脚手架代码成功

运行项目

npm run serve

查看安装版本

vue/cli -V
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: vue