The use of ref in React

Example: get the distance from the button element to the top of the page ref is written on html elements import React,{Component,Fragment} from 'react'; import Child from './Child'; class Counter extends Component{ constructor(props){ super(props); this.addCount=this.addCount.bind(this); this.state={ ...

Posted by Aebx on Tue, 14 Apr 2020 16:01:49 +0200

Anonymous functions, immediate execution functions and closures in JavaScript

Anonymous functions have no function name and cannot be used alone; Immediate execution function is implemented based on anonymous function, and there is no function name. It will be executed immediately after definition; A closure is a function that has access to variables in the scope of another function. Anonymous functions and immediate exe ...

Posted by Mortier on Tue, 14 Apr 2020 12:09:10 +0200

Simple demonstration of React component life cycle

The lifecycle of a component can be divided into three states: Mounting: real DOM insertedUpdating: being re renderedUnmounting: moved out of the real DOM   Life cycle approaches include:componentWillMount is invoked before rendering and the client is also on the server side.componentDidMount: call after the first rendering, only on the client ...

Posted by oaskedal on Tue, 14 Apr 2020 07:53:12 +0200

Props, State and render functions in React

Summary of core features of React 1. React: Declarative Development (JS or jQuery attribute command development) 2. Can coexist with other frameworks 3. Componentization 4. One-way data flow (A parent component can directly change the data of a child component, but a child component cannot directly change the data of a parent component)   Props ...

Posted by lukelee on Sun, 12 Apr 2020 19:29:20 +0200

The correct posture of encapsulating echarts in vue project

Why we need to encapsulate echarts Every developer needs to write a complete option configuration from the beginning to the end, which is very redundant In the same project, all kinds of chart design are very similar, even the same, so there is no need to do repeated work all the time Some developers may forget to consider the features of upda ...

Posted by ranjita on Sat, 11 Apr 2020 10:41:54 +0200

SpringBoot -- implementation of login verification code

Today record the implementation of verification code, hope to help you! First, let's look at the effect of the implementation:   The implementation of this verification code does not use too many plug-ins. If you don't speak much, you can directly use the code. You can take it. The org.apache.commons.lang3.RandomUtils tool class is used in the ...

Posted by mubashir on Thu, 09 Apr 2020 17:41:52 +0200

Application of MQTT communication protocol in Unity -- JS implementation

It has been studied in the industrial field for a long time. According to the requirements of digital twin, it is necessary to get through the network, from CLP to IOT to Dass to virtual factory (3D visualization). In order to get through the state of control and anti control, it is necessary to get through the network communication. For Unity ...

Posted by rhyspaterson on Thu, 09 Apr 2020 16:34:19 +0200

Seven new features of jdk8 Nashorn JavaScript

Introduction Nashorn is a JavaScript engine. Starting from JDK 1.8, nashorn replaced Rhino (JDK 1.6, JDK 1.7) as an embedded JavaScript engine of Java. Nashorn fully supports the ECMAScript 5.1 specification and some extensions. It uses new language features based on JSR 292, including invokedynamic introduced in JDK 7, to compile JavaScript i ...

Posted by ASDen on Wed, 08 Apr 2020 09:42:33 +0200

Drag,drag,drag! Pull out the Bili Bili side navigation component

I. Preface This article mainly talks about the side navigation and drag components of bleblebleblebler in a macro form, which is very suitable for you who are learning VUE gradually. A proper imitation development project is a necessary skill for front-end learning. Most people know that the interview needs to have their own works, and th ...

Posted by brauchi on Mon, 06 Apr 2020 10:11:53 +0200

Abort signal: how to cancel asynchronous tasks in JavaScript

By Tomasz Jakut Crazy technology house Original text: ckeditor.com/blog/Aborti... No reprint without permission Sometimes it can be difficult to perform asynchronous tasks, especially when a specific programming language does not allow you to cancel operations that are not started by mistake or are no longer needed. Fortunately, ...

Posted by kustomjs on Mon, 06 Apr 2020 04:14:50 +0200