06 2021 档案

摘要:1、二进制流转换成文件流 const file = new window.File([data],name) // data二进制文件,name:文件名称 2、转换成formData格式 var formData = new FormData(); formData.append("file", f 阅读全文
posted @ 2021-06-19 08:57 pyx204 阅读(1137) 评论(0) 推荐(0)
摘要:本例子是手机端页面,该音频播放是某个音频点击后跳转的页面,需带播放音频的url,若需求不一样,可以把created中从地址去掉从地址栏读取url,js代码逻辑不变,可自行改样式 示例图 <template> <div class="pageWrap rowJcAc"> <audio ref="aud 阅读全文
posted @ 2021-06-18 15:18 pyx204 阅读(4441) 评论(0) 推荐(0)
摘要:data中需要定义的变量 logoUrl: '', // 裁剪后的图片 // 裁剪组件是否展示 dialogVisible: false, // 裁剪组件的基础配置option option: { img: '', // 裁剪图片的地址 info: true, // 裁剪框的大小信息 outputS 阅读全文
posted @ 2021-06-18 14:50 pyx204 阅读(263) 评论(0) 推荐(0)
摘要:1、浅拷贝 const obj = { name: '张三', age: 18, friend: {name: '小夏'} } const newObj = obj obj.age = 20 console.log(obj.age) // 20 console.log(newObj.age) // 阅读全文
posted @ 2021-06-17 18:04 pyx204 阅读(57) 评论(0) 推荐(0)
摘要:效果图 源码 <template> <div class="calendar-wrapper"> <!-- 月份变换区 --> <div class="header rowJcAc" v-if="headerBar"> <div class="arrowIcon rowJcAc" @click="c 阅读全文
posted @ 2021-06-15 09:57 pyx204 阅读(627) 评论(0) 推荐(0)
摘要:在data中定义需要的变量 data() { return { websock: '', reconnectTimer: '', // 重连定时器 pageDestroyed: false, // 页面是否销毁 websocketIsJump: false, // websocket 心跳是否正常 阅读全文
posted @ 2021-06-10 16:14 pyx204 阅读(467) 评论(0) 推荐(0)
摘要:方法1:写一个隐藏的input框,让input聚焦,滚动条自动会滚到input所在位置 <input type="text" ref="input"/> this.$refs.input.focus() 方法2: 用scrollIntoView() <div ref="box"></div> thi 阅读全文
posted @ 2021-06-08 15:35 pyx204 阅读(76) 评论(0) 推荐(0)