会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Hubelian的博客
博客园
首页
新随笔
联系
订阅
管理
2023年8月15日
JavaScript获取音频文件时长
摘要: getTimes(file) { var content = file; var url = URL.createObjectURL(content); //经测试,发现audio也可获取视频的时长 var audioElement = new Audio(url); audioElement.ad
阅读全文
posted @ 2023-08-15 10:51 ·休伯利安
阅读(1180)
评论(0)
推荐(0)
2023年3月22日
vue中设置input输入框的值为正整数,不能为负数和小数
摘要: import Vue from 'vue' Vue.directive('Int', { bind: function (el) { const input = el.getElementsByTagName('input')[0] input.onkeyup = function (e) { if
阅读全文
posted @ 2023-03-22 18:24 ·休伯利安
阅读(1002)
评论(0)
推荐(0)
2023年2月25日
字符串与base64相互转换
摘要: 字符串转base64 function encode(str){ // 对字符串进行编码 var encode = encodeURI(str); // 对编码的字符串转化base64 var base64 = btoa(encode); return base64; } base64转字符串 fu
阅读全文
posted @ 2023-02-25 10:44 ·休伯利安
阅读(265)
评论(0)
推荐(0)
2023年2月1日
使用this.$http.get 和 this.$http.post传参
摘要: get: getInfo(){ this.$http.get('接口地址',{params:{参数}},{emulateJSON:true}).then(result =>{ console.log(result) }) }post: getInfo(){ this.$http.post('接口地址
阅读全文
posted @ 2023-02-01 16:34 ·休伯利安
阅读(755)
评论(0)
推荐(0)
2022年12月28日
vue根据汉字添加拼音
摘要: 效果如下 安装工具库 npm install pinyin-pro 或者 yarn add pinyin-pro 封装组件 change-pinyin <template> <div class="pinyin"> <div class="wordBox" v-for="(item,index) i
阅读全文
posted @ 2022-12-28 17:25 ·休伯利安
阅读(423)
评论(0)
推荐(0)
2022年12月27日
切换npm 镜像源
摘要: 查看当前镜像源 npm config get registry 切换为国内镜像源 npm config set registry=https://registry.npm.taobao.org/
阅读全文
posted @ 2022-12-27 14:43 ·休伯利安
阅读(86)
评论(0)
推荐(0)
公告