1. First, you need to install node sass, because sass loader depends on it npm install node-sass --save-dev 2. Install sass loader npm install sass-loader --save-dev 3. Modify the style tag and declare to use sass <style lang="scss" scoped></st ... Read the full text »
barben
4 years ago (2020-05-13) 5825 Browse 1 Comments
ten Likes
Shocked! Encapsulates a component. What you get is an empty array using wx. createSelectorQuery(). selectAll(). boundingClientRect()!? The solution was unexpected, which made me feel sad. When I learned it, I gasped and could not speak on the spot! Add. in (this) to the component const query = wx.createSelectorQuery().in( ... Read the full text »
barben
4 years ago (2020-05-06) 3060 Browse 0 Comments
two Likes
Recently, I was working on a small program project and wanted to encapsulate a request for an interface address that is easy to manage. Baidu has found for a long time that the wheels provided by many predecessors are not suitable for me. So I made this wheel myself. I just need to declare the request method and address in the file. It will be very convenient to manage the interface and use it later. 1. Create the api.js file to encapsulate the wx.request request // import apiList from './ ApiList '//Use import index Read the full text »
barben
Four years ago (April 22, 2020) 2852 Browse 0 Comments
two Likes
Keywords: automated export "It is not necessary to import everything, just export default to json, and then import automatically in main" ... Read the full text »
barben
Four years ago (April 22, 2020) 1642 Browse 0 Comments
three Likes
The life cycle of WeChat applet is divided into application life cycle (App) and page life cycle (Page). 1、 Applet life cycle The life cycle function of the applet application is called in the app.js file. The App() function is used to register an applet and receive an object as a parameter, which specifies the callback of the applet's life cycle. The calling sequence of the applet life cycle: onLaunch (when the applet initialization is completed, and the global trigger is only once)>onShow (applet startup Read the full text »
barben
Four years ago (April 14, 2020) 1527 Browse 0 Comments
two Likes
Subsequently, in the article Understanding the Set Structure in ES6, we said that the new Set structure in ES6 is similar to an array, but there is no duplicate value. So we can use this feature to implement the array de duplication operation. Use the Array.from method First convert the array to Set type to remove duplicate values, and then use Array. from to convert it back to an array. var arr = [1, 4, 3, 3, 2, 2, 3]; var newAr ... Read the full text »
barben
4 years ago (2020-04-03) 2971 Browse 0 Comments
four Likes
Then, at the end of the last article Understanding the Set Structure in ES6, when I summarized the knowledge points, I saw a method to use the relevant knowledge in [Extension of ES6 Array] to achieve "finding the union, intersection and difference sets of two sets". It is very simple. The implementation method is as follows: let a = new Set([1, 2, 3]); let b = new Set([4, 3, 2]); //Union let union = ne ... Read the full text »
barben
4 years ago (2020-04-02) 2901 Browse 0 Comments
three Likes
What is a Set? ES6 adds a new data structure called Set. It is similar to an array, but it does not duplicate values. What can be the parameters of new Set()? 1. Array 2. Objects similar to arrays For example, the NodeList collection returned by the DOM operation and the arguments object inside the function. //NodeList object document.querySelectorAll('p'); // argu ... Read the full text »
barben
4 years ago (2020-04-02) 2753 Browse 0 Comments
three Likes
Today, when making the back button on the upper left corner of the mobile phone, a desperate operation was unlocked: If I enter the address directly in other pages to visit my project, and click Back in the project, I will jump back to that page directly. What's the difference between this and the browser's fallback function!!! Don't all mobile websites jump back to the home page if there is no previous page??? //This happens with the go and back methods of vue router this.$ router.go(-1); this ... Read the full text »
barben
4 years ago (2020-03-13) 3964 Browse 1 Comments
six Likes
This is the first article in the Year of the Rat! It is also the first task to complete the development of the WeChat public account mobile terminal project after the forced holiday when we just started working remotely! Without much talk, vue goes! 1、 Installing the lib flexible plug-in [lib flexible] Mobile terminal elastic layout adaptation solution. Used to set the benchmark value of rem. The plug-in will automatically set the font size of the html root element, which is set to one tenth of the screen width by default. For example, if the current Read the full text »
barben
4 years ago (March 12, 2020) 3216 Browse 0 Comments
eight Likes