• Welcome to the eight blog of that year. I am very glad to meet you at the right age.
  • The little buddy who has logged on QQ due to the theme shows the default head in the comments. Please go to the personal center to upload the avatar again.

Vue encapsulates Axios

 Vue encapsulates Axios
And the previous article "WeChat small package request request" is very much like the unique For cycle writing. The advantage is really clean. ~ 1, new two files, used for the encapsulation of Axios and the management of interfaces. I have built a new index.js and apiList.js under src/assets/js/api, and encapsulated Axios in index.js: import Axios from'axios'... Read the full text.

Barben 1 months ago (06-05) 85 browse 0 comment Two Praise

Vue modularized data, such as element form validation.

 Vue modularized data, such as element form validation.
Why modularity of data? When you use the form component of element today, you see that the form checking rule is a mess of piles written in the data of the page. So, I think, can you put all the rules of form check together for easy management? So I did these things... To build a new JS file, you can put this JS file in any location you want to place in the project. Then, in this JS file, write your data and use export default to count... Read the full text.

Barben 1 months ago (05-29) 98 browse 0 comment Eight Praise

Small program components cannot access nodes with selectAll.

 Small program components cannot access nodes with selectAll.
Shocked! Encapsulated a component, using wx.createSelectorQuery ().SelectAll ().BoundingClientRect () to get is actually an empty array! The solution is unexpected. It makes people feel sad. Xiaobian learned that after he took a breath of cool air, he could not speak on the spot. In the component, pay attention to adding.In (this) to const query = wx.createSelectorQuery ().In (... Read the full text.

Barben 2 months ago (05-06) 103 browse 0 comment Two Praise

WeChat applet encapsulates request requests

 WeChat applet encapsulates request requests
Recently, in the process of making small programs, I want to encapsulate a convenient management interface address. After a long time, Baidu found that many of the wheels provided by predecessors were not suitable for me. So he built the wheel himself, only declaring the request mode and the request address in the file. It will be very convenient to manage the interface and use it later. 1, create api.js file, encapsulate wx.request request / / import apiList from'./apiList'/ / use import lead... Read the full text.

Barben 3 months ago (04-22) 123 browse 0 comment Two Praise

Vernacular understanding the life cycle of WeChat applet

 Vernacular understanding the life cycle of WeChat applet
The life cycle of WeChat applet can be divided into application life cycle (App) and page life cycle (Page). (1) small program life cycle. The life cycle function of applet application is called in app.js file. The App () function is used to register a small program and receive an object as a parameter, which specifies the callback of the minor program's lifecycle. The calling sequence of the small program life cycle is onLaunch (small program initialization is completed, and the whole world only triggers once) > onShow. Read the full text.

Barben 3 months ago (04-14) 105 browse 0 comment Two Praise

ES6 uses Set to realize array weight removal.

 ES6 uses Set to realize array weight removal.
Later, in the understanding of Set structure in ES6, we have said that the new Set structure in ES6 is similar to an array, but there is no duplicate value. So we can make use of his characteristic to realize the operation of array de emphasis. To use the Array.from method, first convert the array to Set type, remove duplicate values, and then use Array.from to turn it back into an array. var arr = [1, 4, 3, 3, 2, 2, 3], var newAr... Read the full text.

Barben 3 months ago (04-03) 160 browse 0 comment Two Praise