一步一步教你如何使用Vue CLI创建项目
最编程
2024-08-07 12:05:18
...
vue脚手架 —> vue.cli
快速的创建一个大型的功能齐全的vue项目模板(初始化项目)
土味解释:快速的创建一个空的vue项目
安装(全局安装)
- 全局安装
> npm i @vue/cli -g
- 创建vue脚手架项目
> vue create 项目名
配置选项
Vue CLI v4.5.11 ? Please pick a preset: (Use arrow keys) > Default ([Vue 2] babel, eslint) Default (Vue 3 Preview) ([Vue 3] babel, eslint) Manually select features
- 按上下选择 ,回车确认,这里选择第三项手动
选择功能
Vue CLI v4.5.11 ? Please pick a preset: Manually select features ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection) >(*) Choose Vue version (*) Babel ( ) TypeScript ( ) Progressive Web App (PWA) Support ( ) Router ( ) Vuex ( ) CSS Pre-processors (*) Linter / Formatter ( ) Unit Testing ( ) E2E Testing
- 上下移动光标,空格选择,回车确认,这里选择 1 2 5 6 选项
选择版本
? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex ? Choose a version of Vue.js that you want to start the project with (Use arrow keys) > 2.x 3.x (Preview)
- 这里选择 2.x
是否使用历史模式
? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n)
- 这里输入n 回车
Babel, ESLint等的配置位置
? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys) > In dedicated config files In package.json
- 这里选择选择第一项 专用配置文件存放
是否存为预置
? Save this as a preset for future projects? (y/N)
- 这里选择 n
创建成功
Vue CLI v4.5.11 Creating project in D:\MyStudy\myvue2. ⚙️ Installing CLI plugins. This might take a while... > core-js@3.9.1 postinstall D:\MyStudy\myvue2\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}" > ejs@2.7.4 postinstall D:\MyStudy\myvue2\node_modules\ejs > node ./postinstall.js added 1208 packages from 928 contributors in 21.836s 61 packages are looking for funding run `npm fund` for details ???? Invoking generators... ???? Installing additional dependencies... added 5 packages from 1 contributor in 4.671s 61 packages are looking for funding run `npm fund` for details ⚓ Running completion hooks... ???? Generating README.md... ???? Successfully created project myvue2. ???? Get started with the following commands: $ cd myvue2 $ npm run serve
进入项目 目录
> cd myvue2
启动服务
> npm run serve
DONE Compiled successfully in 2492ms App running at: - Local: http://localhost:8080/ - Network: http://192.168.17.154:8080/ Note that the development build is not optimized. To create a production build, run npm run build.
到此这篇关于vue脚手架项目创建步骤详解的文章就介绍到这了,更多相关vue脚手架项目创建内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
推荐阅读
-
如何在Vue-cli3创建的项目中使用Mxgraph?实例演示
-
一步一步教你如何使用Vue CLI创建项目
-
ANSYS Workbench入门指南,一步步教你如何使用
-
一步一步教你如何从零开始建立一个完整的 Vue3.x 工程化项目
-
一步一步教你如何在Java中创建JAR文件并让项目使用它
-
如何轻松使用JMeter进行HTTP接口测试 - 一步步教你设置线程组、 cookie、默认值与Sampler,加上响应断言和监听器,打造基础测试案例。针对复杂情况,将子系统和流程测试分类组织,确保数据一致性。同时,别忘了感谢阅读,给新手提供实战学习资源与全套测试指南,助你轻松踏上自动化测试之路! - 在"测试计划"点击右键,添加"线程组"并设定初始"线程数"和"循环次数" - 配置"HTTP Cookie管理器"与"Http请求默认值",输入目标系统信息,如域名、端口、协议等,让所有相关Sampler共享这些默认设置 - 在线程组内增加"HTTP Request"的Sampler,并填入接口详情,比如路径、请求方法及参数 - 添加"响应断言"检查接口返回结果,通过正则表达式验证预期结果 - 安装监听器,实时查看测试执行状况 - 如需处理流程性接口,请依次添加多个相关Sampler,关联前后请求间的上下文数据 特别提示:为了帮助大家避免学习中的曲折,我们准备了详尽的视频和文档资料库,无论你是软件测试的新手还是老司机,都能从中找到所需的全方位支持。只需点击下方链接加入我们的学习交流社群,就能立刻获取这份珍贵的学习宝藏!再次感谢您的耐心阅读,愿它成为您前行路上的一大助力!
-
一步一步教你如何在IDEA中从零开始搭建SSM全栈项目
-
一步一步教你如何使用Vue.js自定义表单组件
-
快速入门:使用Vue-cli创建项目(第一篇)
-
一步一步教你使用 CSS 创建简单漂亮的导航栏(代码详情)