Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install vue-cli

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to install vue-cli". In daily operation, I believe many people have doubts about how to install vue-cli. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to install vue-cli". Next, please follow the editor to study!

1. Preface

Vue-cli is a tool for deep combination with vue, which can quickly help us create vue projects and create some scaffolding-related code for us. The real use of vue development projects, are using vue-cli to create the project.

2. Vue-cli introduction

Vue CLI is a complete system for rapid development based on Vue.js, providing:

Interactive project scaffolding implemented through @ vue/cli.

Zero configuration prototype development through @ vue/cli + @ vue/cli-service-global.

A runtime dependency (@ vue/cli-service), which:

(1) upgradeable

(2) built on webpack with reasonable default configuration; 9

(3) it can be configured through the configuration file within the project.

(4) it can be extended through plug-ins.

A rich collection of official plug-ins that integrates the best tools in the front-end ecosystem.

A fully graphical user interface for creating and managing Vue.js projects.

Vue CLI is committed to standardizing the tool base in the Vue ecology. It ensures that various build tools can connect smoothly based on intelligent default configurations, so you can focus on writing applications without having to spend days wrestling with configuration issues. At the same time, it also provides each tool with the flexibility to adjust its configuration without the need for eject.

2.1 、 CLI

CLI (@ vue/cli) is a globally installed npm package that provides vue commands on the terminal. It can quickly build a new project through vue create, or prototype new ideas directly through vue serve. You can also manage all your projects through a graphical interface through vue ui.

2.2, CLI service

The CLI service (@ vue/cli-service) is a development environment dependency. It is a npm package that is partially installed in every project created by @ vue/cli.

CLI services are built on top of webpack and webpack-dev-server. It contains:

Load core services for other CLI plug-ins

An internal webpack configuration optimized for most applications

Vue-cli-service commands within the project, providing serve, build, and inspect commands.

2.3.The CLI plug-in

CLI plug-ins are npm packages that provide optional features to your Vue project, such as Babel/TypeScript translation, ESLint integration, unit testing, and end-to-end testing. The name of the Vue CLI plug-in starts with @ vue/cli-plugin- (built-in plug-in) or vue-cli-plugin- (community plug-in), which is easy to use.

When you run the vue-cli-service command inside the project, it automatically parses and loads all the CLI plug-ins listed in package.json.

Plug-ins can be added to the project at a later stage as part of the project creation process. They can also be grouped into a set of reusable preset.

3. @ vue-cli installation

Vue CLI 4.x requires Node.js v8.9 or later (v10 or higher is recommended). You can use NMagol NVM or nvm-windows to manage multiple Node versions on the same computer.

The installation commands are as follows:

Npm install-g @ vue/cli

You can use this command to check whether the version is correct

Vue--version at this point, the study on "how to install vue-cli" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report