welcome

摘要: /** * 下载图片到本地 * @param {String} domId img标签的id * @param {String} name 下载图片名称 */ function downloadCanvasIamge(domId, name){ let image = new Image() // 阅读全文
posted @ 2022-10-10 17:47 一首弦曲献仙音 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 1.绑定安全域名 登录微信公众平台,进入“公众号设置”的“功能设置”里填写“JS接口安全域名”; 2.引入JS文件 工程化项目可通过npm下载:weixin-js-sdk,需要1.6.0以上版本; npm install weixin-js-sdk@1.6.0 在当前页面引入 const wx = 阅读全文
posted @ 2022-04-25 14:42 一首弦曲献仙音 阅读(4456) 评论(0) 推荐(0) 编辑
摘要: setTimeout(()=>{ let newurl = updateQueryStringParameter(window.location.href, 'id', '123456'); //向当前url添加参数,没有历史记录 window.history.replaceState({ path 阅读全文
posted @ 2021-12-07 17:19 一首弦曲献仙音 阅读(990) 评论(0) 推荐(0) 编辑
摘要: 代码展示: <template> <div class="home"> <div id="sendMsg" contenteditable="true" class="textarea" @input="input" @compositionstart="compositStart" @compos 阅读全文
posted @ 2021-12-07 16:34 一首弦曲献仙音 阅读(635) 评论(0) 推荐(0) 编辑
摘要: minSsToHourMinSs(str){ // str 格式为 min:ss (160:59) let arr = str.split(':'); let hour = parseInt(arr[0] / 60); let min = arr[0] - (hour * 60); let ss = 阅读全文
posted @ 2021-12-01 16:37 一首弦曲献仙音 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 如下是我们需要得到的文字大小和字体的效果: 自定义字体、文字大小JS部分: //引入Qill插件 import Quill from "quill"; // 自定义字体 let fontFamily = ['宋体', '黑体', '微软雅黑', '楷体', '仿宋', 'Arial', '苹方']; 阅读全文
posted @ 2021-11-25 17:54 一首弦曲献仙音 阅读(2222) 评论(0) 推荐(1) 编辑
摘要: 如需想要这种效果,不使用div,可直接使用标签 <fieldset> <legend>姓名</legend> <input type="text" placeholder="请输入..." /> </fieldset> 阅读全文
posted @ 2021-11-17 10:38 一首弦曲献仙音 阅读(37) 评论(0) 推荐(0) 编辑
摘要: <div id="barEcharts" style="width: 500px;height:400px;"></div> init() { this.charts = echarts.init(document.getElementById('barEcharts')); // 绘制左侧面 co 阅读全文
posted @ 2021-11-16 18:30 一首弦曲献仙音 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 1.转File对象 let files = new window.File([bits], file.name, {type: file.type}) bits img/Blob/base64 格式图片 2.File对象转base64 封装 async fileToBase64(file) { /* 阅读全文
posted @ 2021-11-12 11:43 一首弦曲献仙音 阅读(1508) 评论(0) 推荐(0) 编辑
摘要: 1、压缩方法公共js /** 图片压缩,默认同比例压缩 * @param {Object} fileObj * 图片对象 * 回调函数有一个参数,base64的字符串数据 */ export function compress(fileObj, callback) { try { const ima 阅读全文
posted @ 2021-10-21 16:51 一首弦曲献仙音 阅读(269) 评论(0) 推荐(0) 编辑
//博文图片放大缩小 //飘桃花效果