会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
welcome
春
节
一首弦曲献仙音
首页
新随笔
管理
上一页
1
2
3
4
5
6
下一页
2022年10月10日
下载图片到本地
摘要: /** * 下载图片到本地 * @param {String} domId img标签的id * @param {String} name 下载图片名称 */ function downloadCanvasIamge(domId, name){ let image = new Image() //
阅读全文
posted @ 2022-10-10 17:47 一首弦曲献仙音
阅读(58)
评论(0)
推荐(0)
2022年4月25日
微信公众号正确使用开放标签wx-open-launch-weapp
摘要: 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 一首弦曲献仙音
阅读(5652)
评论(0)
推荐(0)
2021年12月7日
js为浏览器URL追加参数
摘要: setTimeout(()=>{ let newurl = updateQueryStringParameter(window.location.href, 'id', '123456'); //向当前url添加参数,没有历史记录 window.history.replaceState({ path
阅读全文
posted @ 2021-12-07 17:19 一首弦曲献仙音
阅读(1016)
评论(0)
推荐(0)
《VUE》可编辑div限制字数
摘要: 代码展示: <template> <div class="home"> <div id="sendMsg" contenteditable="true" class="textarea" @input="input" @compositionstart="compositStart" @compos
阅读全文
posted @ 2021-12-07 16:34 一首弦曲献仙音
阅读(695)
评论(0)
推荐(0)
2021年12月1日
js分秒格式转时分秒
摘要: 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 一首弦曲献仙音
阅读(414)
评论(0)
推荐(0)
2021年11月25日
quill富文本编辑器自定义字体、文字大小(编辑器内含element上传组件)
摘要: 如下是我们需要得到的文字大小和字体的效果: 自定义字体、文字大小JS部分: //引入Qill插件 import Quill from "quill"; // 自定义字体 let fontFamily = ['宋体', '黑体', '微软雅黑', '楷体', '仿宋', 'Arial', '苹方'];
阅读全文
posted @ 2021-11-25 17:54 一首弦曲献仙音
阅读(3643)
评论(0)
推荐(1)
2021年11月17日
表单边框缺一角效果
摘要: 如需想要这种效果,不使用div,可直接使用标签 <fieldset> <legend>姓名</legend> <input type="text" placeholder="请输入..." /> </fieldset>
阅读全文
posted @ 2021-11-17 10:38 一首弦曲献仙音
阅读(47)
评论(0)
推荐(0)
2021年11月16日
《ECharts》伪立体柱状图
摘要: <div id="barEcharts" style="width: 500px;height:400px;"></div> init() { this.charts = echarts.init(document.getElementById('barEcharts')); // 绘制左侧面 co
阅读全文
posted @ 2021-11-16 18:30 一首弦曲献仙音
阅读(406)
评论(0)
推荐(0)
2021年11月12日
Img、File、Base64类型互相转换
摘要: 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 一首弦曲献仙音
阅读(1564)
评论(0)
推荐(0)
2021年10月21日
图片压缩并上传
摘要: 1、压缩方法公共js /** 图片压缩,默认同比例压缩 * @param {Object} fileObj * 图片对象 * 回调函数有一个参数,base64的字符串数据 */ export function compress(fileObj, callback) { try { const ima
阅读全文
posted @ 2021-10-21 16:51 一首弦曲献仙音
阅读(284)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告
//博文图片放大缩小
//飘桃花效果