随笔分类 -  JavaScript

javaScript
vue vue.config.js 配置
摘要:1. 开启 sourceMap // 显示 sourceMap , 便于调试 // process.env.NODE_ENV 有的是 dev/prod, 有的是 development/production, 需要自己确认下 productionSourceMap: process.env.NODE 阅读全文

posted @ 2023-11-02 13:28 正义的伙伴! 阅读(221) 评论(0) 推荐(0) 编辑

edge 禁用 自带的 json 视图
摘要:1. edge 禁用 自带的 json 视图 # 改为 disable, 自带的 json 显示大的数字有问题, 超出javascript 最大值导致错误 edge://flags/#edge-json-viewer 阅读全文

posted @ 2023-10-27 17:04 正义的伙伴! 阅读(576) 评论(0) 推荐(0) 编辑

chrome 跨域问题解决
摘要:## 1. 后端设置了跨域, https 下可以, http 不可以 高版本 chrome 配置了策略, 如果访问私有网络, 会出现禁止跨域 chrome://flags/#block-insecure-private-network-requests Block insecure private 阅读全文

posted @ 2023-06-09 11:53 正义的伙伴! 阅读(318) 评论(0) 推荐(0) 编辑

package.json scripts 备忘
摘要:## 传参 ```sh ## -- 后面跟参数 ## 参考 https://stackoverflow.com/questions/11580961/sending-command-line-arguments-to-npm-script npm run pack -- -i ``` 阅读全文

posted @ 2023-06-01 17:38 正义的伙伴! 阅读(8) 评论(0) 推荐(0) 编辑

js 获取 image 原始高度
摘要:1. 新版浏览器 ```js // 这个 api 仅支持新版本浏览器, 旧版还是得创建一个内部图片 setTimeout(() => { let imgRef = this.$refs.img this.imgWidth = imgRef.naturalWidth this.imgHeight = 阅读全文

posted @ 2023-05-30 16:27 正义的伙伴! 阅读(52) 评论(0) 推荐(0) 编辑

echarts 饼图位置调整
摘要:设置echarts饼状图大小:一、控制大小;series下的 radius : [‘54%’, ‘90’], 这个属性设置图的大小;第一个参数是控制里面小圈的大小,第二个参数是控制外面大圈的大小;举例: radius: ['40%','60%'],1 radius: ['40%','90%'],1 阅读全文

posted @ 2023-03-15 16:03 正义的伙伴! 阅读(4840) 评论(0) 推荐(0) 编辑

关于变量命名
摘要:来源: https://mp.weixin.qq.com/s?__biz=MzA4NzQ0Njc4Ng==&mid=2247506141&idx=1&sn=2d7148b31fdb9e7c23d77696fabd9228&chksm=903bdcb0a74c55a60ae526f5b5ea12e9e 阅读全文

posted @ 2023-03-15 13:04 正义的伙伴! 阅读(50) 评论(0) 推荐(0) 编辑

vue (或者 javascript ) 打印彩色日志
摘要:type Any = any /** * 创建 console 所需的 style 样式 * @param bgColor * @param fontColor */ const createStyle = function(bgColor: string, fontColor = '#fff'): 阅读全文

posted @ 2023-03-10 09:48 正义的伙伴! 阅读(438) 评论(0) 推荐(0) 编辑

node.js 前端 node-sass 安装失败解决方案
摘要:在 github 页面 https://github.com/sass/node-sass/releases 中直接下载文件, 然后设置 windows 环境变量 SASS_BINARY_PATH=C:\data\env\nodejs-lib\win32-x64-93_binding.node 阅读全文

posted @ 2022-09-17 11:31 正义的伙伴! 阅读(67) 评论(0) 推荐(0) 编辑

echarts 备忘
摘要:1. 画线 参考: https://echarts.apache.org/examples/zh/editor.html?c=scatter-anscombe-quartet&lang=js 示例代码 const markLineOptFactory = (start = [0.3, 0], end 阅读全文

posted @ 2022-08-18 10:48 正义的伙伴! 阅读(49) 评论(0) 推荐(0) 编辑

quill 问题备忘
摘要:修改图片对其方式后, 内容没有刷新的 bug https://github.com/kensnyder/quill-image-resize-module/issues/31#issuecomment-547265562 阅读全文

posted @ 2022-05-27 16:01 正义的伙伴! 阅读(22) 评论(0) 推荐(0) 编辑

typescript 缓存的 index.d.ts 写法
摘要:/** * store.legacy 缓存 <br/> * see: /fe-lib/storejs/store.legacy.min.js */ class store { // 获取缓存 static get<T extends keyof StoreKvMapping>(key: T): St 阅读全文

posted @ 2022-03-16 13:36 正义的伙伴! 阅读(335) 评论(0) 推荐(0) 编辑

vue 打包 js css 添加 hash
摘要:vue项目打包文件增加hash值 (vue-cli 3 无需额外的配置) vue-cli2项目 修改vue项目根目录下的 build/webpack.prod.conf.js文件 js文件: output: { path: config.build.assetsRoot, filename: uti 阅读全文

posted @ 2022-02-23 13:50 正义的伙伴! 阅读(2365) 评论(0) 推荐(0) 编辑

ckeditor5 集成问题
摘要:1. mathType 保存图片回显无法更新问题 ckeditor5 会将属性解析到 span(inline) ,或者 figure 上(block), 这时候需要自己写个插件配置下。 参考: https://ckeditor.com/docs/ckeditor5/latest/framework/ 阅读全文

posted @ 2022-01-27 22:32 正义的伙伴! 阅读(171) 评论(0) 推荐(0) 编辑

vue-cli 3 编译时 css 放在 body 里
摘要:修改 vue.config.js // https://stackoverflow.com/questions/58263664/vue-js-inject-styles-in-body-instead-of-head-of-index-html-webpack-htmlweb class Inje 阅读全文

posted @ 2022-01-13 12:31 正义的伙伴! 阅读(271) 评论(0) 推荐(0) 编辑

js location.href 循环下载问题
摘要:location.href 循环只能下载最后一次的文件, 使用如下代码 var a = document.createElement('a');//在dom树上创建一个a标签 var url = url a.href = url;//将url赋值给a标签的href属性 a.download = '入 阅读全文

posted @ 2021-10-14 09:38 正义的伙伴! 阅读(736) 评论(0) 推荐(0) 编辑

promise 相关
摘要:1. promise 的 catch 并不能处理 异常!,需注意, 应该用 reject 而不是 throw 抛出异常 阅读全文

posted @ 2021-08-26 14:13 正义的伙伴! 阅读(14) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
//增加一段JS脚本,为目录生成使用
点击右上角即可分享
微信分享提示