Web
JSUtils – 自定义EventEmitter
class EventEmitter { constructor() { this.events = {}; } on(type, handler) { if (!this.eve…
WeApp – 变量未定义或变量设置为undefined时不会同步wxml
建议为变量赋值时定义 null 兜底 const res = opts.param || null; this.setData({ res })
Video – 标签四周出现黑色边框问题
如图:视频周围出现了黑色线条 解决方案:在video标签加上css样式:mix-blend-mode: darken; 更多解释参考:https://blog.csdn.net/q…
WeApp – 小程序Video组件真机下底部出现黑边
如下图 video 标签已配置 object-fit: cover翻查微信开放社区后,发现此问题官方暂未优化掉。https://developers.weixin.qq.com/c…
Typescript – 配置项目别名Alias
日常我们code时,大多数人习惯喜欢使用@/path/file导入文件,而不是../../../path/file的方式导入。 在Typescript中配置Alisa 打开 tsc…
WeApp – 小程序自定义文字水印组件
预览效果 代码 // components/text-watermark/index.js Component({ options: { multipleSlots: true /…
Typescript – Error: Cannot find module ‘@/xxx’ 找不到模块
参考:https://www.5axxw.com/questions/content/t8ci4x 已经在tsconfig.json 中配置了paths别名,编辑的时候引用正常,但…
WeApp – 真机scroll-view 中设置border-radius无效?
在节点上设置样式:transform: translate3d(0, 0, 0);
Demo – 老虎机抽奖(H5)
案例地址:http://jsrun.net/IPTKp 预览图:
React – TypeScript 50 条规范和经验
转自 https://cloud.tencent.com/developer/article/1446958
Request – 文件流下载
如何将后台的文件流下载? Axios示例 Excel 下载 axios.get(APIURL, params, { responseType: 'arraybuffer'//这也行…
React – Component 细节整理
React Component 目录 React 组件细节 componentDidMount只执行一次(最后更新:2021-03-18 14:48) componentDidMo…
Node – 请求提交参数大小超范围(Request Entity Too Large)
Node.js上传文件提示HTTP请求体超出大小 报错信息: PayloadTooLargeError: request entity too large 默认的Node.js服务…
React – Router 可选参数 /:id?
常见动态param写法: { path: "/post/detail/:post_id" } 其中post_id为一参数字段,当页面打开时,通过 props.match.param…
WeChat – 微信公众号H5优化
Meta 元标签 更新 2020-09-10 10:03 INIT <meta content="yes" name="apple-mobile-web-app-capabl…
JSUtils – 递归查找指定条件子节点
根据以下数据来看,层级大致为 [国家->省份->城市],是一个三级的树结构。在应用中,我们可能只会使用到里面的value和parent字段关联父子关系。 所以就有了一种…