- 博客(4)
- 收藏
- 关注
翻译 笔记
this指向 在一个函数上下文中,this由调用者提供,由调用函数的方式来决定。如果调用者函数,被某一个对象所拥有,那么该函数在调用时,内部的this指向该对象。如果函数独立调用,那么该函数内部的this,则指向undefined。但是在非严格模式中,当this指向undefined时,它会被自动指向全局对象。 ##new的创建过程 先理清楚 new 关键字调用函数都的具体过程,那么写出来就很清楚了 首先创建一个空的对象,空对象的__proto__属性指向构造函数的原型对象 把上面创建的空对象赋值构造函数内
2020-09-09 10:51:20 75
原创 react-redux使用
import {connect} from 'react-redux' import {bindActionCreators} from 'redux'; import {mainMenuClickCreator} from "@/redux/main-menu"; //最上引入mainMenuClickCreator.js const mapStateToProps = (state) => { return { currentRoute: state.Router.cur
2020-09-08 16:33:47 121
原创 Generator函数
Generator 函数 function* gen(x) { var y = yield x + 2; return y; } var g = gen(1); g.next() // { value: 3, done: false } g.next() // { value: undefined, done: true } next方法的作用是分阶段执行Generator函数。每次调用next方法,会返回一个对象,表示当前阶段的信息(value属性和done属性)。value属性是yield语
2020-09-08 16:22:45 84
原创 面向对象 封装拖拽对象
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> <style type="text/css"> .target{ color:red; width:50px; height:50px; background:red; border:1px solid yellow; color:#fff;
2020-09-08 16:12:09 119
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人