Remove html tags in rich text and filters in vue, react and wechat applets
After getting the rich text, as long as part of the content is displayed, the rich text label needs to be removed, and then part of the content needs to be intercepted; then the filter, which has been used many times in wechat applets, has also been encountered in vue and react
1. Remove html tags from rich text
Remove html tags and spaces
let ...
Posted by gabo on Sun, 08 Dec 2019 05:23:18 -0800
React Bucket Configuration Guide in webpack4, Actual!
Latest React Family Bucket Practice Configuration Guide
I'm listening to this document Mr. Lv Xiaoming For the course, Mrs. Lv combined her previous project experience with her own summary document on react webpack redux understanding, which took a total of one week to summarize. I hope to benefit the readers. I am here to do more basic proces ...
Posted by mbeals on Fri, 06 Dec 2019 14:33:11 -0800
Advanced components of React manuscript
Higher-Order Components
HOC is not a standard API for React.
HOC is a function.
HOC returns a Component.
Example:
const EnhancedComponent = higherOrderComponent(WrappedComponent);
Usage scenarios
code reuse
Similar to mixin before React 0.15.
When multiple components use the same code or the same method, HOC can be used.
Example:
import React ...
Posted by Threepwood on Fri, 06 Dec 2019 11:48:00 -0800
redux core steps
concept
redux is an architecture mode, which can be used in combination with react and vue.
Problems solved
Modify the shared data state gracefully to avoid unnecessary (difficult to eliminate) problems caused by the cascading changes of parent-child components (it is troublesome to change if there are many child components) and external change ...
Posted by Errant_Shadow on Wed, 04 Dec 2019 23:15:49 -0800
Get started with React 0x013: Context
0x000 overview
ContextIs the overall situation.stateLa~~
0x001 problem
First, we need the chestnutsTopbarUsed intheme,howeverthemeMust be passed in from the outermost, so it must be passed in from the outermostApp,Re introductionTopBar,This is only passed twice, but if all components need tothemeWhat about it? Or a very deep component need ...
Posted by chetanrakesh on Wed, 04 Dec 2019 20:10:42 -0800
#04-HK custom city selection list
04-HK custom city selection list
This article is hkzf The series of mobile tutorials aims to help beginners quickly master the project development based on React technology stack through a series of articles.
requirement analysis
The custom city list is divided into two parts. The left side is divided into three parts: current location, hot ci ...
Posted by Cynix on Wed, 04 Dec 2019 19:29:20 -0800
React 1.6 adds support for sass and less
Add sass and less support in the new version of react respectively. Note that the project is created with the create react app scaffold tool.
Add sass support
Adding sass support is very simple. You only need to execute the following command to install node sass. If it does not take effect, please restart the project.
npm i node-sass --save
Ad ...
Posted by rasherb on Wed, 04 Dec 2019 05:36:20 -0800
#03-HK rental integration Redux
03-HK integrated Redux
This article is hkzf The series of mobile tutorials aims to help beginners quickly master the project development based on React technology stack through a series of articles.
Redux introduce
motivation
JavaScript needs to manage more states than ever, and Redux tries to make state changes predictable
Three principles
S ...
Posted by mistercash60000 on Wed, 04 Dec 2019 00:39:48 -0800
Lazy loading of components in dva
On demand loading of components is an important means to improve the performance of the first screen.
dva@2.0 uses react router @ 4.0. There are changes in the way it is used. Online discussions are basically old. If it is unclear, it will be messy. Here is a record.
Before dva@2.0
There are many discussions about lazy loading before dva@2.0. P ...
Posted by loweauto on Tue, 03 Dec 2019 12:27:54 -0800
Local storage local storage use
Store data
localStorage.setItem("name","Amy") //Store the variable with name and Amy
localStorage.name = "Amy"; // Equivalent to the above command
localStorage // Storage{name: "Amy", length: 1} read data
Read data
localStorage.getItem("name") //Amy, read the value of the variable named name stored in the localStorage ob ...
Posted by eatc7402 on Mon, 02 Dec 2019 10:59:53 -0800