Use of React hooks
0. Create react project
Now create a react project using the create react app, the official scaffold of react:
Step 1: install scaffold NPM install - G create react app globallyStep 2: switch to the directory where you want to create the project and use the command: create react app react_ projectStep 3: switch the directory to the projec ...
Added by Nulletz on Fri, 11 Feb 2022 14:02:27 +0200
[TypeScript 4.5] 004 - Chapter 4 type reduction
[TypeScript 4.5] 004 - Chapter 4 type reduction
1, typeof type guard
1. What is type reduction
meaning
TypeScript type reduction is the process of converting from wide type to narrow type
Type reduction is often used in scenarios that deal with union type variables
code analysis
function padLeft(padding: number | string, input: strin ...
Added by phpvolution on Fri, 11 Feb 2022 11:41:18 +0200
Introduction to difficult points of Jest unit test
Article toneIntroduce the concept and thinking process, and do not provide code (refer to the specific code writing method) jest official website)Extension:In the era of information explosion, all kinds of resources are very rich. There are many materials on the InternetHowever, the details of the official website do not duplicate the same info ...
Added by jonoc33 on Fri, 11 Feb 2022 11:37:27 +0200
Section 20: object oriented design patterns
Object creation review
Object direct quantityUsing the new operatorObject.create() method
reference resources: Section 3: data type - Object object
When we create objects, we usually create a single object. If we need to create multiple objects, there may be a lot of duplicate code.
this point resolution
① In the function: this represents ...
Added by larissahn on Fri, 11 Feb 2022 11:26:16 +0200
web H5 web browser Bluetooth
target
Recently, a project is being developed. The requirements of the project are as follows: On the H5 (based on vue framework) page, call the webluetooth interface through js to read the data transmitted by a Bluetooth device and return to the display.
introduce
background
With the rise of PWA, more and more web services are supporte ...
Added by WendyLady on Fri, 11 Feb 2022 10:50:25 +0200
Vue -- 02. Basic syntax, binding event, two-way binding, component
1, Basic syntax: v-bind, v-if, v-else, v-else-if, v-for
1.1 v-bind binding element
<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<!--view Layer, template-->
<div id="app">
...
Added by RosieisSweet on Fri, 11 Feb 2022 10:46:55 +0200
[React] detailed tutorial
preface
1. Contrast between react and vue
1.1 what is modularity
It is analyzed from the perspective of code
Separate some reusable codes into separate modules; Facilitate the maintenance and development of the project
1.2. What is componentization
It is analyzed from the perspective of UI interface
Separate reusable UI elements
1 ...
Added by iainr on Fri, 11 Feb 2022 08:55:25 +0200
es6 common related problems
ES6 common related problems
1. The difference between ES5 and ES6
1. The difference between var, let and const
The difference between var, let and const
1,var
In ES5, the top-level object (window object) is equivalent to the global variable. The variable declared with var is not only the global variable, but also the top-level variable Top ...
Added by Bounty on Fri, 11 Feb 2022 08:47:38 +0200
SSM framework integration ideas (personal view)
SSM framework integration ideas (personal view)
The ssm framework is frequently used in projects. In order to focus on the business code in the project, I sorted out the steps to be used by the ssm framework. The following figure is the result of the sorting. (the green box in the figure is the key point of the process, and the changes in each ...
Added by froggie81 on Fri, 11 Feb 2022 07:57:10 +0200
I developed a software based on egg JS back-end scaffold
background
Previously based on egg JS has developed several projects. It is found that each project has functions such as configuration file, database connection operation, data model definition, wechat login authorization processing, etc. when making A new project, it will always copy the previous project to delete and modify. Sometimes A pra ...
Added by clairian on Fri, 11 Feb 2022 06:23:01 +0200