随笔分类 - JS
JavaScript一些知识
摘要:const scrollTimer = ref(null) //滚动防抖定时器 const currentTop = ref(null) //实时滚动高度 const scrollTop = ref(0) //防抖结束后的滚动高度 function bindScrollEvent() { windo
阅读全文
摘要:组件代码/components/float-bubble.vue <template> <transition> <div ref="dragArea" class="drag-area" @touchstart.stop="handleTouchStart" @touchmove.prevent.
阅读全文
摘要:https://better-scroll.github.io/docs/zh-CN/guide
阅读全文
摘要:https://blog.csdn.net/weixin_48674314/article/details/129093224
阅读全文
摘要:效果图 文件图 直接贴代码 emotion.vue <template> <div class="emotion-container beauty-scroll-livechat"> <div class="emotion-btn" @click="toggleEmotionShow"> <span
阅读全文
摘要:driver.js(推荐) https://driverjs.com/ vue-tour https://pulsardev.github.io/vue-tour/ intro.js https://introjs.com/docs/ 博客:https://blog.csdn.net/weixin_
阅读全文
摘要:/** * 获取视频时长,单位s * how to use * getVideoDuration('https://xx.xxx.mp4').then(res=>{ * console.log("视频时长",res) * }) */ export function getVideoDuration(
阅读全文
摘要:##贴代码imgformat-deal.js ``` /** * 图片file格式转为base64 * fileToBase64(file).then((res) => {console.log(res.data)}) */ export function fileToBase64(file) {
阅读全文
摘要:##直接贴代码 ``` /** * 截取视频画面 * @param {*} url 视频播放链接 * @param {*} width 画面的截取宽度 * @param {*} height 图片的截取高度 */ export function cutVideoCover(url, width =
阅读全文
摘要:###静态资源路径应该是http开头,访问的时候变成了https开头,导致找不到资源。 ##原因是index.html的一项默认配置,注释掉就好了
阅读全文
摘要:##官方文档 https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html ##贴代码 ``` 【index.html】引入wx文件 【微信登录页面】 //二维码dom容器 //引入
阅读全文
摘要:##handleBase64.js // 处理base64的转码和解码 const handleBase64 = function () { let _keyStr ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
阅读全文
摘要:## 使用sortable.js实现 ###官方网站: http://www.sortablejs.com/ ###中文文档: https://www.itxst.com/sortablejs/neuinffi.html ``` 1、yarn add sortablejs 2、需要重新运行项目 ``
阅读全文
摘要:###本文转载自 https://www.ucloud.cn/yun/104458.html 摘要:命令用于规定模块的对外接口,命令用于输入其他模块提供的功能。前者用于服务器,后者用于浏览器。命令接受一对大括号,里面指定要从其他模块导入的变量名。基本用法其他和主要区别为前者是动态加载。 在日常开发中
阅读全文
摘要:##下载及安装pdf.js插件 ###【下载】前往官方地址下载插件包 http://mozilla.github.io/pdf.js/ 注:不建议使用npm或yarn的形式安装pdf.js的依赖包,因为我们很多定制化的需求需要改源码 ###【安装】在public文件夹下新建pdfjs文件夹,将解压后
阅读全文
摘要:##直接贴代码 ###封装一个方法 /** * @param { * } file input选择后返回的file对象 */ export const compressImage = (file) => { // 参数file,是通过input 选择本地文件获取的 return new Promis
阅读全文
摘要:####友情链接:uniapp中使用websocket实现实时聊天功能 https://www.cnblogs.com/huihuihero/p/13491922.html ##直接贴代码 <div class="chat-content"> <div class="comment-list" id
阅读全文
摘要:##总结 JS构造函数-实例对象-原型对象之间的关系 构造函数可以实例化对象;(通过构造函数,实例化,创建的就是实例对象。) 构造函数中有一个属性叫prototype,是构造函数的原型对象; 实例对象的原型对象(__proto__)指向的是该构造函数的原型对象(prototype);(实例对象通过_
阅读全文