Use the wepy framework to create a new small program project

Attachment: the official website quick start link (click me to jump directly)

Open the command line
1. Install wepy globally

npm install @wepy/cli -g

Check the installation is successful

 wepy --help

Insert picture description here
The global installation is successful

2. New project

1. Execute the command (wepy_test is the name of the project, you can fill in at will)

wepy init standard wepy_test

Insert picture description here
Created successfully

Insert picture description here

2. Enter the project

Project directory
Insert picture description here

Installation dependencies

cnpm install

You can use it after the installation is successful

npm run dev

Start and compile the project

Three. View the project

Use the developer tools to import the root directory of the new project to preview the effect.

Insert picture description here

Insert picture description here

Project directory structure

Insert picture description here

Those who have studied vue understand that this directory structure is the same as vue-cli

added successfully

4. Introduce vant components

Attachment: Please click here on vant official website

Excuting an order

 cnpm i @vant/weapp -S --production

Insert picture description here

Put the dist folder in vant_weapp under node_modules into the components folder

Insert picture description here

Insert picture description here

usingComponents: {
    
    
  'van-button': '../components/vant/button/index'
}

Just try to introduce a component, whether it is successful

Insert picture description here

Successful display, successful introduction

Guess you like

Origin blog.csdn.net/lb1135909273/article/details/104626873
Recommended