Redux in TS Redux in Typescript is different from Redux in JS. We will need define the type specificly. Build Folders as Following. Create Reducerswe will need define state type and action type here. import Actio 2021-11-09 React TypeScript Redux React Hook
后台返回数据类型转换 --- Tree and Flat Data Convert 扁平数组转换为树形结构 Flat to Treevar arr = [{id: 1, pid: '0'},{id: 11, pid: '1'},{id: 12, pid: '1'}] function listToTreeWithLevel(list, parent, level 2021-10-18 Data Tree-Flat-Data-Convert 树形扁平结构互转
Axios请求参数形式 Types of URL Parameters by Axios ParamsIf we use params, the data exposed in url and It is not safe sometimes. For example, if we are using axios.get() and axios.post(…,{params:{}}) Body form-dataThe data can be a file or key/value. 2021-10-14 Axios
Express Middleware TypesI list some middleware that frontend developer normally use to get data.There are several type of HTTP Request as following: query form path cookie header Install and Declarationnpm install exp 2021-10-14 Express NodeJS
Express Router Module If we got a lot of routes when we doing enterprise level projects, we will need module the routes. Import express and open portconst express = require('express') const app = express( 2021-10-14 Express Module NodeJS
Vuex Vuex1.概念在Vue中实现集中式状态(数据)管理的一个Vue插件,对vue应用中多个组件的共享状态进行集中式的管理(读/写),也是一种组件间通信的方式,且适用于任意组件间通信。 2.何时使用?多个组件需要共享数据时 3.搭建vuex环境 创建文件:src/store/index.js //引入Vue核心库 import Vue from 'vue' //引入Vuex import Vuex 2021-10-12 组件通信 Vue Vuex
Vue路由 --- Vue Route 路由1.基本使用 安装vue-router,命令:npm i vue-router 应用插件:Vue.use(VueRouter) 编写router配置项: //引入VueRouter import VueRouter from 'vue-router' //引入组件 import About from '../components/About' import Home from '../co 2021-10-12 Router Vue
Vue组件通信 --- Transfer Data in Vue 1. props / $emitThe following is showing the parent component passing data to child. // parent <template> <div class="section"> <com-article :articles 2021-10-12 组件通信 Vue
React Hooks React Hook/Hooks(1). Hook是React 16.8.0版本增加的新特性/新语法(2). 可以让你在函数组件中使用 state 以及其他的 React 特性 三个常用的Hook(1). State Hook: React.useState() (2). Effect Hook: React.useEffect() (3). Ref Hook: React.useRef() S 2021-10-12 React Hooks
React 组件通信--- Transfer Data in React 正常props父子传递 children propsclass A extends Component { state = {name:'tom'} render() { const {name} = this.state return ( <div className= 2021-10-12 React 组件通信