Prerequisites: The global NPM environment and wepy tool have been installed.

The wepy version is 2.1.0

The NPM version is 6.14.8

Based on the above environment, do the following to initialize the wepy structured applets project.

1. Create a Wepy (applets) project

wepyInit Standard myPROjInitialize the project using the Standard template
Copy the code
cdMyproj (project folder name)Go to the project directory
Copy the code
npm install Install project dependencies
Copy the code
npm run dev # listen and compile the project
Copy the code

2. Install the less/sass

Operation steps:

1: installation of sass

npm i node-sass
Copy the code

2: Install the wepy-Compiler-sass plug-in

npm install wepy-compiler-sass --save-dev
Copy the code

3: configuration wepy. Config. Js

3. Install THE UI framework – Vant retry P

Vant – weapp: youzan. Making. IO/vant weapp /…

Operation steps:

1. Install Vant retry P

npm i @vant/weapp -S --production
Copy the code

(Note: Never forget the “@”)

2. Reference it to the xxx.wepy file

<config> {navigationBarTitleText: 'WePY 2.0 Feature Demo', usingComponents: {"van-button": "module:@vant/weapp/dist/button", } } </config>Copy the code

Problem description:

1. I used baidu to find dist in the node_modules file library, copy it to the SRC /components/ newly created Vant folder, and then reference it. However, the Vant effect does not show up in any way, nor does the reference path report errors. Various attempts to clean up the WEpy cache have failed. Finally try to solve the problem according to the above. Hereby note that elder brother can explain.