摘要:
html, body { margin: 0; padding: 0; height: 100%; width: 100%; overflow: hidden; } #upload { position: fixed; top: 0; left: 0; } audio { position: fix 阅读全文
摘要:
<template> <ul> <li v-for="item in items" :key="item">{{ item }}</li> </ul> </template> <script> // 防抖 const debounce = (fn, delay) => { let timer = n 阅读全文
摘要:
move.js const move = { install(Vue) { Vue.directive('move', { inserted(el, binding) { const { x = 0, y = 0, zIndex = 100 } = binding.value || Object.c 阅读全文
摘要:
file形式访问 <body> <button id="takePhoto">takePhoto</button> <div id="app"></div> <script> class Camera { constructor(root, width = 480, height = 320) { 阅读全文
摘要:
components 下 loading 下 Loading.vue <template> <transition name="fade"> <div class="loading_container" v-show="visible"> <div class="loading_wrapper"> 阅读全文
摘要:
看下图,仔细看↓ class VideoIcon { constructor(videoPath, iconSize = 32) { this.videoPath = videoPath; this.iconSize = iconSize; this.iconLink = null; this.vi 阅读全文
摘要:
该方法使用了XHR来加载音乐文件,所以不能以file形式访问,可以使用http-server来构建一个本地服务访问 class Music { constructor(url, loop) { const AudioCtx = AudioContext || webkitAudioContext | 阅读全文
摘要:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <input id="upload" type="file"/> <script> const FIL 阅读全文
摘要:
function* fn() { let [x, y] = [0, 1]; while (true) { yield y; [x, y] = [y, x + y]; } } for(let i of fn()) { if (i > 1000) break; console.log(i); } 利用了 阅读全文
摘要:
koa2采用async和await来处理异步,koa2实例的use函数的参数都是中间件。 先来看一个koa2的核心小demo // 中间件的仓库 const arr = [ async (next) => { console.log(1) await next() console.log(2) }, 阅读全文