摘要: 原理 1. postinstall 时将 `node_modules` 下的小程序组件包复制到 `wxcomponents` 目录下 2. 第三方包建议只用 `package.json` 管理,所以将代码加入 .gitignore 中 核心代码 // scripts/pkg-copy.js// 本脚 阅读全文
posted @ 2021-07-14 14:27 savokiss 阅读(1533) 评论(0) 推荐(0) 编辑
摘要: 可添加如下规则: pattern reqDelay://timeMS 如针对 /api 的请求模拟 10s 超时: www.test.com/api reqDelay://10000 更多详见:reqDelay 阅读全文
posted @ 2021-06-29 11:54 savokiss 阅读(849) 评论(0) 推荐(0) 编辑
摘要: node.js 有一个内置类: URL 不需要引入,只需要直接使用即可 const res = new URL('https://www.baidu.com'); console.log(res); // 输出如下内容 URL { href: 'https://www.baidu.com/', or 阅读全文
posted @ 2021-06-21 21:36 savokiss 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 列出项目下所有作者以及提交次数 git shortlog -sne --all 列出过去一年项目下哪些文件被提交次数最多 git rev-list --after='one year ago' --objects --all | git cat-file --batch-check='%(objec 阅读全文
posted @ 2021-06-01 15:09 savokiss 阅读(32) 评论(0) 推荐(0) 编辑
摘要: .prettierrc.js 配置如下: module.exports = { // 一行最多 120 字符 printWidth: 120, // 使用 2 个空格缩进 tabWidth: 2, // 不使用缩进符,而使用空格 useTabs: false, // 行尾需要有分号 semi: tr 阅读全文
posted @ 2021-05-28 22:13 savokiss 阅读(1260) 评论(0) 推荐(0) 编辑
摘要: prettier 官方有三个跟 eslint 相集成的工具: https://prettier.io/docs/en/integrating-with-linters.html 它们的具体区别见:https://gist.github.com/savokiss/e5e585f30d3c775a07c 阅读全文
posted @ 2021-05-21 18:56 savokiss 阅读(1138) 评论(0) 推荐(0) 编辑
摘要: _.debounce(sendMail, 300, { leading: true, trailing: false })); 打开 leading,注意关掉 trailing 即可 详见:https://devdocs.io/lodash~4/index#debounce 阅读全文
posted @ 2021-05-07 15:28 savokiss 阅读(460) 评论(0) 推荐(0) 编辑
摘要: 执行 npm login 后,查看 ~/.npmrc 文件 registry=https://registry.npmjs.org///registry.npmjs.org/:_authToken=yyyyy-xfxxx-ffff-rrrr-xxxxxxxxx 新建 .npmrc 文件放在 项目根目 阅读全文
posted @ 2021-04-21 14:51 savokiss 阅读(1294) 评论(0) 推荐(0) 编辑
摘要: tag 分为 annotated 和 lightweight 两种类型 git push --follow-tags 此命令只会 push annotated tag git tag 默认打的是 lightweight 类型的,如果需要打 annotated 使用: git tag -a 官方说明: 阅读全文
posted @ 2021-04-21 14:40 savokiss 阅读(1320) 评论(0) 推荐(0) 编辑
摘要: dom 结构 <div class="iframeWrap"> <iframe class="iframe" v-bind="$attrs" scrolling="auto" :src="localUrl"></iframe> </div> css 样式 .iframeWrap { width: 1 阅读全文
posted @ 2021-02-04 17:47 savokiss 阅读(503) 评论(0) 推荐(0) 编辑