摘要: react项目中有用到高阶组件装饰器的写法,然后项目就报错,信息如下: Support for the experimental syntax 'decorators-legacy' isn't currently enabled 解决方法: 1、安装 babel-plugin-transform- 阅读全文
posted @ 2021-12-14 17:00 木易锅巴 阅读(1137) 评论(0) 推荐(0) 编辑
摘要: 记录函数式父组件,调用函数式子组件实例方法 父组件: const Parent = () => { return <Child /> } 子组件: const Child = () => { const inputRef = useRef() const focusFun = () => { inp 阅读全文
posted @ 2021-06-01 15:06 木易锅巴 阅读(5853) 评论(0) 推荐(0) 编辑
摘要: const imgArrs = ['imageurl1', 'imageurl2', 'imageurl3'] const loadImg = () => { if (!imgArrs.length) return; const img = new Image() img.src = imgArrs 阅读全文
posted @ 2021-05-22 19:30 木易锅巴 阅读(738) 评论(0) 推荐(0) 编辑
摘要: var fs = require('fs'); var path = require('path'); var filePath = path.resolve(process.cwd(), 'src/pages/Crm'); //调用文件遍历方法 fileDisplay(filePath); /** 阅读全文
posted @ 2021-01-30 21:23 木易锅巴 阅读(399) 评论(0) 推荐(0) 编辑
摘要: const msgContent = str.replace(/{{([^}]+)}}/g, function(full, part) { console.log(full, part); return `<span class='color'>${part}</span>`; }); 上述代码可用 阅读全文
posted @ 2021-01-30 21:21 木易锅巴 阅读(183) 评论(0) 推荐(0) 编辑
摘要: class ScrollPic { constructor(opt = {}) { console.log(opt, 'opt'); this.opt = this.initOpt(opt); this.root = document.querySelector(this.opt.root); co 阅读全文
posted @ 2021-01-20 18:50 木易锅巴 阅读(173) 评论(0) 推荐(0) 编辑
摘要: // getBoundingClientRect export function imgLoad() { const viewHeight = document.documentElement.clientHeight || document.body.clientHeight; // 获取可视区高 阅读全文
posted @ 2021-01-20 18:44 木易锅巴 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 最近在做一个后台管理系统供内部人员使用,交互性没有那么强,所以对于每个页面请求时要加loading,感觉要写的比较麻烦,然后去百度了下能不能全局实现loading: 需要loading的请求发出后,让loading显示,请求后无论成功还是失败就让loading关闭 大概代码如下: const { r 阅读全文
posted @ 2021-01-11 19:29 木易锅巴 阅读(3570) 评论(9) 推荐(0) 编辑
摘要: 不小心删除了远程的分支feature_EMR2.2.2_guoba,如何恢复? #查看reflog,找到最后一次commitid git reflog --date=iso git reflog用来记录你的每一次命令,--date=iso 表示以标准时间显示,这里要注意的是不能用git log,gi 阅读全文
posted @ 2020-09-07 14:23 木易锅巴 阅读(4755) 评论(0) 推荐(2) 编辑
摘要: 需求:列表多页勾选实现批量打印流行病学问卷调查,打印出每一个患者(每一条数据)流行病学调查问卷。 分析: 通常多页勾选实现批量打印,我们的做法都是,将所有的数据统一传给后端的一个协议,但是这个需求比较特殊,用户要求单独一个患者有一份自己单独打印出来的问卷,同后端讨论后,我们为了实现需求,决定实现的方 阅读全文
posted @ 2020-08-13 16:34 木易锅巴 阅读(5841) 评论(3) 推荐(0) 编辑