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

Detailed explanation of the integer data type tinyint in MySQL

Table of contents 1.1Tinyint Type Description 1.2...

Detailed explanation of MySQL database Event scheduled execution tasks

1. Background As the project's business conti...

js to implement a simple bullet screen system

This article shares the specific code of native j...

Details on how to use class styles in Vue

Table of contents 1. Boolean 2. Expression 3. Mul...

How to install Jenkins on CentOS 8

To install Jenkins on CentOS 8, you need to use t...

How to install nginx in docker and configure access via https

1. Download the latest nginx docker image $ docke...

Complete steps to use element in vue3.0

Preface: Use the element framework in vue3.0, bec...

Tips for creating two-dimensional arrays in JavaScript

Creation of a two-dimensional array in Js: First ...

In-depth explanation of the global status of WeChat applet

Preface In WeChat applet, you can use globalData ...

How to remove carriage return characters from text in Linux

When the carriage return character ( Ctrl+M ) mak...

Convert psd cut image to div+css format

PSD to div css web page cutting example Step 1: F...

Introduction to the steps of deploying redis in docker container

Table of contents 1 redis configuration file 2 Do...

Metadata Extraction Example Analysis of MySQL and Oracle

Table of contents Preface What is metadata Refere...