How to use webpack to optimize the development / production environment

HMR hot module replacement / module hot replacement Function: when a module changes, it will only update the module (not package all) to improve the speed Style file: you can use the HRM function because the style loader is implemented internally js file: no HRM by default html file: there is no HRM by defau lt, and the html file cannot be ...

Posted by PugJr on Tue, 07 Dec 2021 00:22:02 -0800

4 powerful JavaScript operators

Did you spend an afternoon reading Mozilla documents? If so, you will find a lot of JS information on the Internet, which makes it easy for us to ignore the more basic JS operators.These operators are uncommon but powerful! It looks very similar in grammar, but its function is different. You must read it carefully.1,?? Non air operatorIn JS,?? ...

Posted by growler123 on Mon, 06 Dec 2021 23:42:13 -0800

Several ways of JS array traversal

JS array traversal is basically for,forin,foreach,forof,map and other methods. The following describes several array traversal methods used in this analysis and performance analysis and comparison The first is a normal for loop The code is as follows: for(j = 0; j < arr.length; j++) { } Brief description: the simplest one is also the ...

Posted by 9mm on Mon, 06 Dec 2021 23:31:41 -0800

Use of mock.js

Usually, during the project process, the data returned by the api you need may not be completed at the back end, but only documents. At this time, you need to use mock to intercept ajax requests, generate random data, and complete the data rendering of the page There are different deployment schemes for mock.js, so I won't list them one by one ...

Posted by wikstov on Mon, 06 Dec 2021 23:11:49 -0800

JS implementation of four digital kilogram formatting methods to share

The so-called digital thousandth form, that is, from the single digit, add a comma between every three digits. For example, "10000". To meet this requirement, I initially wrote such a function: Method 1 The code is as follows: // Method 1 function toThousands(num) { var result = [ ], counter = 0; num = (num || 0).toString() ...

Posted by airo on Mon, 06 Dec 2021 20:19:46 -0800

vueX of vue state management

preface Over the past few years, I have been struggling in the it industry. Along the way, many have summarized some high-frequency interviews in the python industry. I see most of the new blood in the industry, and I still have all kinds of difficult questions for the answers to all kinds of interview questions or collection Therefore, I dev ...

Posted by Madatan on Mon, 06 Dec 2021 18:43:11 -0800

React saga workflow

1. Download the toolkit Redux, react Redux and Redux saga in the project  yarn add redux  yarn add react-redux  yarn add redux-saga 2. Create Redux folder and corresponding directory in src directory 3. Introduce createStore in store.js Create store: call the createStore() method to get the store. The parameter passed in the method is a ...

Posted by thatsme on Mon, 06 Dec 2021 14:25:15 -0800

Re combing the basic knowledge of ECMAscript in JavaScript

catalogue 1, Operator 1. Arithmetic operator Find the area of a circle 2. Assignment operator 3. Unary operator 4. Comparison operator 5. Logical operators 6. Operator priority 2, Statement 1. Expressions and statements 2. Branch statement 1.if branch statement Case: Case: 2. Ternary operator Case: 3.switch statement Case: s ...

Posted by Matt Kindig on Mon, 06 Dec 2021 12:48:38 -0800

Use vitepress + github Pages to build your own blog website

Vuepress should have been used by many people, and   VitePress   yes   VuePress   The next generation framework is to support vue 3.0   web site framework.In its documentation, it is called   Vuepress's brothers have some advantages over others:be based on   Vite   instead of   Webpack   So fast ...

Posted by jasoncable on Mon, 06 Dec 2021 10:48:47 -0800

Array Iterator Method

This counting method is primarily used to iterate over array objects, which in turn pass each element of the array to the functions we provide to facilitate iteration, mapping, filtering, testing, and merging of the array. Before talking about these methods, let's first understand that all of them accept a function as their first argument and ...

Posted by arnoldd99 on Mon, 06 Dec 2021 09:50:13 -0800