当前位置: 首页 > news >正文

vue 使用vueCli 搭建vue2.x开发环境,并且指定ts 和less

nodejs 安装过程省略

设置淘宝镜像 永久使用
E:\front-workspace>npm config set registry https://registry.npmmirror.com

# 使用 npm 安装 cnpm(使用淘宝镜像)
npm install -g cnpm --registry=https://registry.npmmirror.com

# 或者使用官方淘宝镜像(两者都可以)
npm install -g cnpm --registry=https://registry.npm.taobao.org

安装VUE脚手架
E:\front-workspace>npm install -g @vue/cli
安装yarn 包管理器
E:\front-workspace>npm install -g yarn
added 1 package in 3s
查看客户端脚手架的版本
E:\front-workspace>vue --version
@vue/cli 5.0.9

创建 Vue 2.x 项目
# 使用 vue create 命令创建项目
vue create vue2-emall-web
在交互式界面中,您可以选择:

选择预设:

Default ([Vue 2] babel, eslint)

Default (Vue 3 Preview) ([Vue 3] babel, eslint)

Manually select features (手动选择功能)

如果选择手动选择,会出现以下选项:
? Check the features needed for your project:
?Choose Vue version
?Babel
?TypeScript
?Progressive Web App (PWA) Support
?Router
?Vuex
?CSS Pre-processors
?Linter / Formatter
?Unit Testing
?E2E Testing

使用键盘上最长的空格键 选择需要的某块
Vue CLI v5.0.9
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, Router, Vuex, CSS Pre-processors, Linter
? Choose a version of Vue.js that you want to start the project with 2.x
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Less
? Pick a linter / formatter config: Standard
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? Yes
? Save preset as: vue2-emall-web

最后回车之后等待项目初始化完成
? Successfully created project vue2-emall-web.
? Get started with the following commands:

 $ cd vue2-emall-web
$ npm run serve

使用 HBuilder x 开发工具打开项目文件夹加载项目之后
在客户终端命令行输入
npm run serve
显示如下内容说明启用成功
- Local:   http://localhost:8080/  - Network: http://172.20.10.9:8080/

  Note that the development build is not optimized.
To create a production build, run npm run build.
http://localhost:8080/  浏览器访问 出现 VUE Welcome to Your Vue.js + TypeScript App 说明前段安装成功

http://www.dtcms.com/a/572807.html

相关文章:

  • 在 iOS 18 离线徒步地图,如何存储和调用?
  • 【iOS】UICollectionView
  • 广东电白建设集团有限公司网站宫免费网站
  • 混淆 iOS 类名与变量名的实战指南,多工具组合把混淆做成工程能力(混淆 iOS 类名变量名/IPA 成品混淆Ipa/Guard CLI 实操)
  • sysstat 概览与使用:sar/iostat/mpstat/pidstat(含基础原理)
  • 纯flex布局来写瀑布流
  • 智能网联汽车与低空经济‌:结合5G技术拓展新兴产业
  • RDD的特点、算子与创建方法
  • 删除小目标 cocojson
  • 汽车EDI:基于知行之桥的 Gnotec EDI解决方案
  • 垂直行业门户网站建设方案自己做的网站被黑了怎么办
  • 地图可视化实践录:leaflet学习之综合示例工程设计
  • 《Python工匠》第二章 数值与字符串 关键知识摘录与梳理
  • QuickSSO 与 ECreator 实操应用案例手册
  • Flutter Android Kotlin 插件编译错误完整解决方案
  • 网站设计问题网站开发包含的项目和分工
  • FPGA—ZYNQ学习UART环回(五)
  • 电动汽车充电云与移动应用基础设施的漏洞识别、攻击实验及缓解策略
  • PFMEA中的预防措施和探测措施区别
  • 做钢材的网站php 7 wordpress
  • 告别繁琐手工录入:智能银行票据套打软件,让制单效率飞跃
  • 【Java】理解 Java 中的 this 关键字
  • 在编译OpenHarmony遇到third_party/libnl编译报错的修复办法
  • 建c2c网站俄罗斯乌克兰为什么打仗
  • vue在获取某一个div的大小,怎么确保div渲染好,内容撑开后才去获取大小
  • ITIL 4 复习练习及解题思路
  • 数据结构:单链表(2)
  • MYSQL数据库--索引、视图练习
  • 2.2.5 运算方法和运算电路【2011统考真题】
  • 前端上传图片加裁剪功能