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

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

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

You've got a few, five bad js-coded habits

For more articles, please pay attention to WeChat Public Number: Front End css and js Dry Have you ever felt this way when reading js code? You hardly understand what the code means? Does the code use a lot of outdated JavaScript techniques? Naming and coding style more casual? These are signs of bad coding habits. This article lists fi ...

Posted by JustinMs66@hotmail.com on Mon, 06 Dec 2021 09:41:05 -0800

Ten minutes to understand generics in TypeScript

Please indicate the source of Reprint: the official website of grape City, which provides professional development tools, solutions and services for developers to empower developers. Original source: https://blog.bitsrc.io/understanding-generics-in-typescript-1c041dc37569 What will you learn in this article This article introduces the con ...

Posted by sstoveld on Sun, 05 Dec 2021 21:44:38 -0800

Component communication between parents and grandchildren of vue and component communication between brothers

Component communication between parent and child components Interview question: what are the communication modes between vue components? The first: props+this.$emit: props: Parent component A binds data through v-bind and transfers data to child components, which are received by props Parent component A: <template> <div class ...

Posted by Bullit on Sun, 05 Dec 2021 19:41:21 -0800

Optimize ES5 grammar using ES6 grammar, welcome to add

ES6 is recommended for program optimization and aesthetics. (All javaScript syntax after ES5 is collectively referred to as ES6) 1. About Value Selection Values are common in programs, such as obj from an object. const obj = { a:1, b:2, c:3, d:4, e:5, } Make complaints: const a = obj.a; const b = obj.b; const c = obj. ...

Posted by geoldr on Sun, 05 Dec 2021 19:25:26 -0800

Learn the knowledge of virtual DOM by writing simple virtual DOM!

Author: deathmoodTranslator: front end XiaozhiSource: mediumThere are dreams and dry goods. Wechat search [Daqian world] pays attention to this bowl washing wisdom who is still washing dishes in the early morning.This article GitHub https://github.com/qq449245884/xiaozhi It has been included. There are complete test sites, materials and my ser ...

Posted by raahatazim on Sun, 05 Dec 2021 19:11:27 -0800