Vue Beginner's Guide: Creating the First Vue-cli Scaffolding Program

Vue Beginner's Guide: Creating the First Vue-cli Scaffolding Program

1. Vue--The first vue-cli program

The development of Vue is based on NodeJS. The actual development uses Vue-cli scaffolding development, vue-router routing, and vuex for state management; for Vue UI, we generally use ElementUI (produced by Ele.me) or ICE (produced by Alibaba) to quickly build front-end projects~~

ElementUI

ICE

1.1 What is vue-cli

A scaffold officially provided by vue-cli, used to quickly generate a vue project template;

The predefined directory structure and basic code are like when we create a Maven project, we can choose to create a skeleton project. This estimated project is the scaffolding, and our development is faster.

Function of the project

  • Unified directory structure
  • Local debugging
  • Hot deployment
  • Unit Testing
  • Integrated packaging and launch

1.2 Required environment

  • Node.js
  • Git

Confirm that nodejs is installed successfully:

  • Enter node -v in cmd to check whether the version number can be printed correctly!
  • Enter npm -v in cmd to check whether the version number can be printed correctly!

insert image description here

npm is a software package management tool

Install vue-cli

npm install1 vue-cli -g
#Test whether the installation is successful#See which templates can be used to create a Vue application. Usually we choose webpack
vue list 

insert image description here

Tip: If the vue list query fails, please add the node_global target to the path environment variable
insert image description here

1.3 The first vue-cli program

1.3.1 Create a Vue project

We just create an empty folder on the computer. I will create a new directory under drive D.

insert image description here

1.3.2 Create a Vue application based on the webpack template

#1. First, you need to enter the corresponding directory cdE:\IDEACode\Vue\vue
#2. Myvue here is the top name, you can name it according to your needs vue init webpack myvue

Just select no all the way;

illustrate:

1.3.3 Initialize and run

cd myvue
npm install
npm run dev

After the command is successfully executed, the following prompt will appear

insert image description here

Open the port in the browser

insert image description here

You can modify the port number and other configuration files in index.js

insert image description here

Summarize

This is the end of this article about the Vue Beginner's Guide to Creating the First vue-cli Program. For more information about the first vue-cli program, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to implement JWT authentication in Vue routing
  • Complete steps for vue dynamic binding icons
  • Vue custom components use event modifiers to step on the pit record
  • Basic usage examples of Vue named slots
  • Vue implements left and right sliding effect example code
  • Implementation of communication between Vue and Flask
  • Vue implements two-way data binding
  • Getting Started with Vue 3.0 Custom Directives
  • Detailed explanation of Vue identity authentication management and tenant management

<<:  Detailed explanation of how to use grep to obtain MySQL error log information

>>:  How to authorize remote connections in MySQL in Linux

Recommend

Is your website suitable for IE8?

During the Olympic Games, IE 8 Beta 2 will be rele...

Detailed process of modifying hostname after Docker creates a container

There is a medicine for regret in the world, as l...

Implementation of CSS3 button border animation

First look at the effect: html <a href="#...

Detailed explanation of map overlay in openlayers6

1. Overlay Overview Overlay means covering, as th...

Some functions of using tcpdump to capture packets in the Linux command line

tcpdump is a flexible and powerful packet capture...

Detailed Example of Row-Level Locking in MySQL

Preface Locks are synchronization mechanisms used...

30 free high-quality English ribbon fonts

30 free high-quality English ribbon fonts for down...

How to compare two database table structures in mysql

During the development and debugging process, it ...

MySQL 5.7.18 version free installation configuration tutorial

MySQL is divided into installation version and fr...

Docker5 full-featured harbor warehouse construction process

Harbor is an enterprise-level registry server for...

Detailed explanation of psql database backup and recovery in docker

1. Postgres database backup in Docker Order: dock...

A brief discussion on several situations where MySQL returns Boolean types

mysql returns Boolean type In the first case, ret...