- 博客(15)
- 资源 (1)
- 收藏
- 关注
原创 js 光标处插入文字
//在光标处插入文字//obj获取标签ID//str要插入的字符function insertText(obj, str) { if(document.selection) { var sel = document.selection.createRange(); sel.text = str; } else if(typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number')
2022-03-03 10:14:01 1365 1
原创 生成文件目录结构【npm】
可以快速的生成本目录下的目录结构npm install mddir -g在文件夹下打开cmd,输入以下命令mddir会生成 directoryList.md 的文件
2022-02-24 15:56:43 918
原创 js blob转json
// 定义JSON数据let val = { "name": "小花" };// 转换成字符串数组let string = JSON.stringify(val);// 转换成Blob类型数据let blobData = new Blob([string]);console.log(blobData) // 打印Blob结果: Blob { size: 17, type: "" }let reader = new FileReader(); // 创建读取文件对象reader.readA
2022-01-13 10:01:42 4064
原创 微信小程序【小程序码传参,自定义埋点】
小程序码传参&小程序URL Scheme获取小程序码,适用于需要的码数量极多的业务场景获取小程序 scheme 码,适用于短信、邮件、外部网页、微信内等拉起小程序的业务场景。token接口:传送门https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=##&secret=##生成小程序码接口:传送门https://api.weixin.qq.com/wxa/getwxaco
2021-12-29 10:37:03 1571
原创 RSA非对称加密传输-前端加密【Uncaught TypeError: Cannot set property ‘default_key_size‘ of null】
这是我对接jsencrypt加密模块的一些心得安装命令npm install jsencrypt引入模块// 正确引入import { JSEncrypt } from 'jsencrypt'// 错误引入// 在main.js 中import { JSEncrypt } from 'jsencrypt'Vue.use(JSEncrypt)// 就会报这个错误Uncaught TypeError: Cannot set property 'default_key_size' of
2021-07-22 20:22:02 432
原创 vue 禁止后退
vue禁止后退,并做相应的操作mounted() { if (window.history && window.history.pushState) { history.pushState(null, null, document.URL); window.addEventListener('popstate', this.goBack, false) } }, destroyed () { window.removeEventLis
2021-04-16 16:49:53 626
转载 el-table 换页保持选中
el-table 换页保持选中<el-table :row-key="(row) => row.accountId" ref="multipleTable" :data="tableData" @selection-change="handleSelectionChange" > <el-table-column type="selection" :reserve-selection="true" width="5
2021-04-14 11:56:04 1190
原创 js 组合键 按键操作
// 简单示例function aa(e) { e = window.event || e; if(e.keyCode == 13) { console.log('触发了回车') }}// 组合键// e.altKey,e.shiftKey,e.ctrlKey,e.metaKey//用来监听键盘上的alt,shift,ctrl,meta键。当按下这些键的时候,值会变为true。// 例如function aa(e) { if(e.ctrlKey && e.keyCo
2021-03-26 16:47:22 1514
原创 vue 微信登录
微信 【页面内登录】npm i vue-wxloginimport wxlogin from "vue-wxlogin";// 组件导入<wxlogin :appid="WxLogInData.appid" :scope="WxLogInData.scope" style="width: 300px; margin: auto" :redirect_uri="WxLogInData.redirect_uri" :self_redirect="false" :href=
2021-03-19 10:31:38 330
原创 js ios 版本12 接口请求无响应问题
经过排查发现,ios 版本12 不支持请求头设置 * (通配符)需要后台设置Access-Control-Allow-Origin: * // 不识别 *正确配置Access-Control-Allow-Origin: *,userId,等等
2021-02-03 17:12:31 653
原创 js 利用audio buffers[int16Array]计算分贝
计算公式:引用:如何计算音频dB级别?来人上代码????????????此处我以录音三秒为例,检测分贝js 公式:avgEnergy : 波形峰值16位比特率:振幅可以高达32767const db = 20 * Math.log10(avgEnergy / 32767);基于npm 【recorder-core】录音框架为例//必须引入的核心,换成require也是一样的。注意:recorder-core会自动往window下挂载名称为Recorder对象,全局可调用window.Rec
2021-01-06 14:52:51 2492 3
原创 Vant [Vue warn]: Failed to resolve directive: lazy
[Vue warn]: Failed to resolve directive: lazy遇到Vant自定义指令找不到的问题可以这样写,亲测有效import Vant,{Lazyload} from 'vant';import 'vant/lib/index.css';Vue.use(Vant);Vue.use(Lazyload);
2020-12-24 19:23:11 6222 2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人