Put the function on the Value of the object, and then pass it to the component for execution to realize the component abstraction

scene In our development, we usually need to code a series of components, but we are programmers. How can we tolerate the bad taste of code repetition? So, for some of the same operations, we need to use loop processing. target We need to display the two buttons at the bottom to create a new inquiry and Purchase Assistant, and click their acti ...

Posted on Tue, 15 Oct 2019 07:22:01 -0700 by BMurtagh

promise source code analysis

The source code is from: Source blog Source code: class Promise2 { constructor(executor) { //Executor executor this.status = 'pending'; //Default wait state this.value = undefined; //Successful value this.reason = undefined //The origin of failure this.onResovleCallbacks = []; this.onRejectedCallbacks = []; ...

Posted on Sun, 13 Oct 2019 07:46:13 -0700 by svguerin3

22. Closure and Inheritance

This article is reproduced in: Professional front-end website 22. Closure and Inheritance == Closures and object-oriented are the focus of interviews.== 1. closure 1. What is a closure function? A function nested in a function is called a closure function. Internal functions can always access the parameters and variables declared in thei ...

Posted on Sat, 12 Oct 2019 17:54:52 -0700 by squalls_dreams

Java adds new rows to the word table and assigns values

Preface: I believe that everyone has had the experience of operating word documents and tables, for each row of data recording and operation is more convenient. But this is not enough. For some OA projects, you need to open word documents online and add data to word tables through background settings, or even add new rows to tables. This requir ...

Posted on Sat, 12 Oct 2019 00:53:04 -0700 by beboo002

Plug-ins to be used in the project optimization process

xtravel-pc-v1 erp PC front-end project Dependent installation npm install element-ui --save With the help of babel-plugin-component, we can only introduce the required components in order to reduce the size of the project. npm install babel-plugin-component -dev npm install vuex --save Precompiled language npm install sass --save npm install cs ...

Posted on Thu, 10 Oct 2019 08:25:30 -0700 by ponsho

Vue unit testing

Unit testing is a test code written to test whether a class or a method can work properly. About Unit Testing What is it: Unit testing is the testing of correctness for the smallest unit of a program. It is to test a page or a method to test the code unit. Significance: It can reduce bugs, improve the efficiency and quality of code, quickly loc ...

Posted on Wed, 09 Oct 2019 17:01:59 -0700 by jeff8j

Elimination of Component Side Effects Based on React Effect Hook Analysis

A component that subscribes to friends online We subscribed to our friends'online status through ID while we were at DidMount.And to prevent memory leaks, we need to clear subscriptions at WillUnmount But when components are displayed on the screen, what happens when friend prop changes? Our component will continue to show the original friend s ...

Posted on Wed, 09 Oct 2019 05:33:42 -0700 by rajns

(Chapter 5) Copying the "Analytical Template Event" of the "Vue Ecology" Series

(Chapter 5) Copying the "Analytical Template Event" of the "Vue Ecology" Series This task Cancel'eval'and replace it with'new Function'. Support users to bind events with'@'and'v-on'. Support initialization of'methods'data. When using a function, you can pass participation without passing parameters, and you can use'$eve ...

Posted on Mon, 07 Oct 2019 22:03:57 -0700 by stomlin

JavaScript | | Data Type Conversion

JavaScript Data Type Value types (basic types): String, Number, Boolean, Null, Undefined, Symbol. Reference data types: Object, Array, Function. * Constants: All languages are basically the same * Integer Floating Point Character Boolean String Object. * Variables * 1. Strongly typed languages: * ...

Posted on Mon, 07 Oct 2019 04:06:46 -0700 by wolves

Talking about Performance and Data Separation

Inadvertently saw an article on the separation of performance and data, a detailed look, feeling and their understanding is not the same, there is this exploration. 1. What is performance and data separation?Statement 1: Separation of performance and data is MVC, which separates data from business logic and distributes it by the controller. Obv ...

Posted on Sat, 05 Oct 2019 19:05:43 -0700 by bdemo2