摘要: Hook 是 React 16.8 的新增特性。它可以让你在不编写 class 的情况下使用 state 以及其他的 React 特性。 hook包含以下函数:useState, useEffect, useContext, useReducer, useMemo, useRef等。引入方式: im 阅读全文
posted @ 2020-02-24 11:12 大豆F4 阅读(406) 评论(0) 推荐(0)
摘要: 原文地址:https://cloud.tencent.com/developer/article/1525156 概述: Blob、ArrayBuffer、File可以归为一类,它们都是数据; FileReader算是一种工具,用来读取数据; FormData可以看做是一个应用数据的场景。 Blob 阅读全文
posted @ 2020-01-06 16:36 大豆F4 阅读(577) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-10-24 18:29 大豆F4 阅读(306) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-10-24 18:19 大豆F4 阅读(1605) 评论(0) 推荐(0)
摘要: 使用场景 下面是几个适合使用 refs 的情况 1、处理焦点、文本选择或媒体控制 2、触发强制动画 3、集成第三方 DOM 库 阅读全文
posted @ 2019-10-10 11:22 大豆F4 阅读(264) 评论(0) 推荐(0)
摘要: 1.问题描述:调用微信小程序API:wx.getLocation,用来获取用户当前的地理位置、速度。进入failed回调函数。 解决方法:在app.json文件中增加一下配置: 解决思路:开发这文档中有说明。调用该API前需要用户授权。 2.问题描述:自定义组件的wxml中包含多个 slot 节点, 阅读全文
posted @ 2019-06-25 18:02 大豆F4 阅读(660) 评论(0) 推荐(1)
摘要: ES6标准: 模块以export/export detault指令导出接口,以import引入模块。 CommonJS规范: 使用require引入模块,使用module.exports/exports导出接口。 在开发中一般使用Babel,将ES6转成CommonJS。 CommonJS允许你动态 阅读全文
posted @ 2019-05-28 16:50 大豆F4 阅读(278) 评论(0) 推荐(0)
摘要: 竖向瀑布流 html页面结构 <div class="masonry"> <div class="item"> <img src="" alt=""> </div> <div class="item"> <img src="" alt=""> </div> <div class="item"> <i 阅读全文
posted @ 2019-04-04 15:51 大豆F4 阅读(1881) 评论(0) 推荐(0)
摘要: 参考网址: https://www.jianshu.com/p/5f8440535a2a 匿名函数中的this指向全局对象 var a = 10; var foo = { a: 20, fn: (function(){ console.log(this); // window console.log 阅读全文
posted @ 2019-04-03 10:10 大豆F4 阅读(687) 评论(0) 推荐(1)
摘要: pip 是一个现代的,通用的 Python 包管理工具 。提供了对Python 包的查找、下载、安装、卸载的功能。 官方提供的pip 示例 $ pip install requests $ pip search xml $ pip show beautifulsoup4 $ pip uninstal 阅读全文
posted @ 2019-04-01 10:45 大豆F4 阅读(642) 评论(0) 推荐(0)