摘要:
计算加法与减法 /** * @params arg1 参与计算的参数1 * @params arg2 参与计算的参数2 * @params type 控制加减(true为减法,false为加法) * */ function accSub(arg1, arg2, type) { let r1, r2, 阅读全文
摘要:
https://juejin.im/post/6844903568487497741 解析react源码 阅读全文
摘要:
注:本文只是给自己的记录,侵权请联系! 参考链接:https://www.jianshu.com/p/e07a5f2de42d demo0: import React from 'react'; import {View, StyleSheet, PanResponder, Text} from " 阅读全文
摘要:
通过添加手势事件 // dx 和 dy:从触摸操作开始到现在的累积横向/纵向路程 // // moveX 和 moveY:最近一次移动时的屏幕横/纵坐标 // // numberActiveTouches:当前在屏幕上的有效触摸点的数量 // // stated:和之前一样,用来识别手指的ID // 阅读全文
摘要:
装饰器函数 装饰器中执行的顺序为从内到外,先执行视图组件的构造函数 ,在从内到外执行装饰器中的构造函数。 如果@asd(‘’)是一个方法,那么需要闭包多嵌套一层函数 function asd(params) { console.log(params); return function DDDD(wr 阅读全文
摘要:
react.memo react.lazy usememo usecallback 父元素更新,子元素不更新,memo,当props发生改变时才去更新子组件 function Parent() { const [count, setCount] = useState(1); const [val, 阅读全文
摘要:
class Base { static instance(){ return new this() } name1(){ return getClassName(this) } static name2(){ return getClassName(new this()) } } class A e 阅读全文
摘要:
function Node(element) { this.element = element; this.next = null; this.previous = null; }function LList() { this.head = new Node("head"); this.find = 阅读全文
摘要:
const url = Platform.OS 'ios' ? `iosamap://navi?sourceApplication=oa&lat=39.90980&lon=116.37296&dev=0` : `androidamap://navi?sourceApplication=appname 阅读全文
摘要:
'''func就是init(),这是一个把函数当做参数,当定义一个装饰器穿参数时,必须要在装饰器的内部将参数传递给执行的函数,否则会报错'''def login(func): def wrapper(*n): print("正在效验中", n) time.sleep(2) print('效验完成') 阅读全文