上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 25 下一页
摘要: IntersectionObserver callback var observer = new IntersectionObserver(callback,options); callback 监听元素的可见性 options 配置参数 callback 一般会触发两次,一次是目标进入视口(可见) 阅读全文
posted @ 2020-10-08 18:36 猫神甜辣酱 阅读(776) 评论(0) 推荐(2) 编辑
摘要: pointer-event css 指针事件属性 .aaa{ // 停止鼠标事件 pointer-events:none; // } 值 SVG all:当指针位于填充或笔触上方时,该元素是目标。 stroke:当指针在笔划上时,该元素是目标。 fill:当指针位于填充上时,该元素是目标。 visi 阅读全文
posted @ 2020-10-07 16:37 猫神甜辣酱 阅读(250) 评论(0) 推荐(0) 编辑
摘要: d3.pointer 获取事件的鼠标指针的位置 let aaa=d3.select('.aaa'); aaa.on('click', function (e) { // 我们发现这个是拿到鼠标在整个页面的坐标 console.log(e.pageX,e.pageY); // 这个是拿到 鼠标在.aa 阅读全文
posted @ 2020-09-29 11:17 猫神甜辣酱 阅读(660) 评论(0) 推荐(0) 编辑
摘要: data let fruits = [ {name: "orange", value: 200}, {name: "apple", value: 124}, {name: "banana", value: 32} ]; let d = d3.select('#bbb').selectAll('div 阅读全文
posted @ 2020-09-24 16:01 猫神甜辣酱 阅读(445) 评论(0) 推荐(0) 编辑
摘要: proprety 设置html元素无法使用属性或者样式的特殊属性,例如input的value ,复选框的 checked, 获取和设置 设置内置属性 // 设置 d3.select('#ccc').property('value','3eee') // 查找 console.log(d3.selec 阅读全文
posted @ 2020-09-23 10:44 猫神甜辣酱 阅读(457) 评论(0) 推荐(0) 编辑
摘要: npm install d3 -S npm install @types/d3 -D import * as d3 from 'd3' d3-selection select 方法 selectAll 方法 // 第一个 d3.select('.box').style('background','r 阅读全文
posted @ 2020-09-18 11:17 猫神甜辣酱 阅读(512) 评论(0) 推荐(0) 编辑
摘要: this 上下文 const book = { title: 'Brave New World', author: 'Aldous Huxley', } function summary() { console.log(`${this.title} was written by ${this.aut 阅读全文
posted @ 2020-09-17 18:32 猫神甜辣酱 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 交叉类型 & 简单的理解成从两个对象中创建一个新对象,新对象拥有两个对象所有的功能 function extend<T extends object, U extends object>(first: T, second: U): T & U { return Object.assign(first 阅读全文
posted @ 2020-09-08 17:28 猫神甜辣酱 阅读(347) 评论(1) 推荐(0) 编辑
摘要: useReducer import React, {useReducer} from 'react' function reducer(state, action) { switch (action.type) { case 'changeName': return {...state, name: 阅读全文
posted @ 2020-08-26 10:55 猫神甜辣酱 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 字符长度 const message = 'Hello!'; const smile = '😀'; [...message].length; // => 6 [...smile].length; // => 1 闭包的正确用法 const counter = (initial = 0) => { 阅读全文
posted @ 2020-08-21 15:51 猫神甜辣酱 阅读(252) 评论(0) 推荐(3) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 25 下一页