JavaScript DOM Event Model

JavaScript is an object-oriented and event-driven language. Event models are essential to DOM. Understanding event-driven mechanisms, event feedback, event bubbles, event capture, and event delegation can help us better handle events and write better code. Event Driven Mechanisms When an event occurs, we receive feedback from the event, whic ...

Posted on Sat, 04 Apr 2020 11:20:39 -0700 by RoBoTTo

redux tutorial (3) using redux in react

react-redux redux implements a mechanism to store state flexibly and provides a method to get state - getState. The only way to change state is to dispatch an action. It also provides a state monitoring mechanism - subscribe. But in a react project, redux has not yet done so - how to inject state into each component container ...

Posted on Fri, 03 Apr 2020 11:32:33 -0700 by rotwyla98

Example of react router DOM (8) sidebar

In the official example of react router DOM, sidebar is a very easy example to implement. The core of odd implementation is to show two groups of Routes. The rendering of this example is as follows: Related core code: import React, {Component} from 'react'; import { BrowserRouter as Router, Route, Link, Sw ...

Posted on Tue, 31 Mar 2020 16:00:08 -0700 by thepip3r

React router prompts when routing is switched

React router version ^ 5.1.2 When the content being edited is not saved, there is a routing switch. At this time, you need to give some prompts, and the user controls whether to jump. During the route management of react router, the Prompt component can be used to realize this function. The message attribute can accept a function and Prompt whe ...

Posted on Wed, 25 Mar 2020 07:07:50 -0700 by sevenfive

A kind of Canvas realizes drawing, zooming, moving and saving historical state on the picture, which is pure dry goods (with css3 conversion formula attached)

Hahaha, I'm here again. This time, I'll bring you some articles about canvas functions. I hope you like them! This css3 change formula can be applied to the transform attribute we usually use or the map zooming on the mobile terminal! Preface Because I am a junior, I am looking for an internship recently. Before that, I had a small projec ...

Posted on Mon, 23 Mar 2020 09:36:09 -0700 by jack_indigo

The mutual transformation between Promise's then and async await

Originally, they were used to process promise. Today, when using react native tree, I found that the author highly praised the writing method of async await So I studied it and replaced my code Let's get to the point When I save values, I write as follows: // Stored value createData(title, successBack, errorBack) ...

Posted on Sat, 21 Mar 2020 09:12:21 -0700 by Julian

Chapter 4 components & components props

1. Transfer of components and component values Before that, we introduced JSX, React elements, and element rendering. Next, we will enter React page composition key components. At this time, we can expand the scope of React elements, which can be divided into native html element tags and user-define ...

Posted on Mon, 16 Mar 2020 06:26:07 -0700 by broann

VUE feature 1: data bidirectional binding

VUE is a kind of MVVM development mode. One of the important characteristics of VUE, which is different from React and other front-end frameworks, is that VUE realizes the bidirectional binding of data and view. 1, Two way binding PK: If you want to realize the two-way binding of an input box for inpu ...

Posted on Tue, 10 Mar 2020 20:49:40 -0700 by Belleanme

ts basic course

ts basic course (2) type inference Joint type Type Asserts Built-in object Class and interface Access modifier Reference link type inference If no type is specified explicitly, ts infers a type according to the rules of type inference 1. ts is more strict Although TS is a js superset, it doe ...

Posted on Fri, 06 Mar 2020 02:21:02 -0800 by gszauer

Common methods of using axios to send requests in React

Install and introduce axios dependency in React To use axios request in React project, you need to install axios first: npm install axios --save Then use typescript to import axios dependency in react file: import axios from 'axios'; GET request with axios There are two ways to use GET requests ...

Posted on Tue, 03 Mar 2020 22:45:51 -0800 by shane18