- 博客(15)
- 资源 (1)
- 收藏
- 关注
原创 处理时间格式
function date(val) { if (!val) return false if (!val.getTime) { let arr = val.split(/[- : T /]/) return new Date(arr[0], arr[1] - 1, arr[2], arr[3], arr[4], arr[5]) } else { return val }}function format(date, fmt) { date = this.date(date) l.
2022-05-10 15:59:28
295
1
原创 好用的md5加密(转载)
忘记在哪cv的了 记录一下function md5(string) { function md5_RotateLeft(lValue, iShiftBits) { return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); } function md5_AddUnsigned(lX, lY) { var lX4, lY4, lX8, lY8, lResult; .
2022-04-19 15:07:29
258
原创 uniapp封装request
新建http.js文件import md5 from "../md5.js";//设置访问的域名前缀// #ifdef H5 console.log('H5') const baseURL = '/app'; //跨域配置// #endif// #ifdef APP console.log('APP') const baseURL = 'http://xxx.xxx.com:xxxx/xxx/xxx';// #endif//补0function repair(.
2022-04-19 15:01:08
865
原创 uni 封装下拉列表组件
<template name="ChoiceSelected"> <!-- 自定义下拉选择框 start--> <view class="selected-all"> <view :class="isShowChoice ? 'drop-down-box-selected' : 'drop-down-box'" @click.stop="btnShowHideClick" > <text cl.
2022-04-07 11:22:45
555
原创 uniapp写小程序的坑(记录)
<video id="video" src=""></video> let video=uni.createVideoContext('video')video.play()获取video元素 不能用ref 不能用原生dom
2022-03-29 09:39:33
648
原创 audio muted属性绑定无效 vue
watch: { muted(val) { if (Array.isArray(this.$refs.audioPlayer)) { this.$refs.audioPlayer.forEach((a) => { a.muted = val; }); } else { this.$refs.audioPlayer.muted = val; } }}监听数据变化手动更改 au..
2022-03-11 10:24:35
1368
原创 (记录)实用方法封装 vue
export default { install(vue, option) {//获取设备列表 vue.prototype.$getDevices = async function () { await navigator.mediaDevices.getUserMedia({ video: true, Audio: true }); return navigator.mediaDevices.enumerateDevices()..
2022-03-04 19:32:39
496
原创 mqtt 封装 极简
import mqtt from "mqtt";import utils from "../util/utils";export class MQTTProxy { TAG = "MQTTProxy" _client _subscribes = {} init() { this._client = mqtt.connect( wss地址 , { username: utils.guid, passw.
2022-03-03 11:09:50
741
原创 window自定义事件
//定义window.dispatchEvent(new CustomEvent("事件名", {参数key:参数value}))//监听window.addEventListener("事件名", 参数key => {})
2022-03-02 17:57:03
2634
1
原创 自定义callBack
//定义test(callBack){ if(callBack&&自己的判断){ callBack(参数 可不填) } if(callBack&&自己的判断){ callBack(参数 可不填) }}//调用test((如果有参数的话就有)=>{ })...
2022-03-02 17:54:21
293
原创 h5浏览器处理
window.onload = function() { // 阻止双击放大 var lastTouchEnd = 0; document.addEventListener("touchstart", function(event) { if (event.touches.length > 1) { event.preventDefault(); } }); document.addEve.
2022-03-02 10:55:31
200
原创 横竖屏旋转内容处理
/* 竖屏 */@media screen and (orientation: portrait) { /* 以vw为单位 */ #root { width: 100vh; height: 100vw; -webkit-transform: rotate(90deg); transform: rotate(90deg); }}/* 横屏 */@media screen and (orientation: landscape) { /* 以vh为.
2022-03-02 10:46:44
371
原创 audio标签autoplay失效处理
<audio :srcObject.prop="_stream" playsInline autoPlay controls muted @canplay="audioAutoPlay($event)" />audioAutoPlay(event) { console.log("audioAutoPlay"); let autoP.
2022-03-02 10:42:05
810
原创 video autoplay 无法播放处理
<video class="video" :srcObject.prop="stream" playsInline autoPlay muted @play="resetMuted($event)" ></video>resetMuted(event) { event.target.muted =.
2022-03-02 10:38:42
498
原创 mqtt封装
import mqtt from './mqtt.min.js'import api from './apiUrl';export const LISTENMQTT = { CONNECT_SUCCESS: 'CONNECTSUCCESS', //链接成功 SUBSCRIBE_SUCCESS: 'SUBSCRIBESUCCESS', //订阅成功 SUBSCRIBE_FAILED: 'SUBSCRIBE_FAILED', //订阅失败 SENDMESSAGE_SUCCE...
2022-03-01 09:17:15
5588
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅