24个解决实际问题的ES6代码段
1、如何隐藏所有指定元素?const hide = (...el) => [...el].forEach(e => (e.style.display = "none")); // Example hide(document.query...
1、如何隐藏所有指定元素?const hide = (...el) => [...el].forEach(e => (e.style.display = "none")); // Example hide(document.query...
最近在搞一个音乐播放器,在获取音频总时长的时候,总是获取到NAN,这有点搞不懂了,然后在网上查询资料,得到了解决方案,如果直接video.duration获取的是NAN,原因貌似是加载音频是异步的,刚刷新完页面还没有加载完成的音频资源,所以得到的是NAN,需要使用oncanplay事件监听
import { BASE_API_URL, TOKEN_NAME } from '@/constant'; import { message } from 'ant-design-vue'; import axios fro...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial...
<html> <head> <meta charset="utf-8"> <script src='https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min....
Refused to display 'https://www.xxxxx.com/' in a frame because it set 'X-Frame-Options' to 'sameor...
通过 title 配置项来实现const init = (data) => { const myChart = echarts.init(document.getElementById('noData')) const ...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta nam...
//粒子 import 'babel-polyfill'; import * as THREE from 'three'; import { OrbitControls } from 'three/examples/...
{ "name": "01", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "dev": "parcel src/index.htm...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>使用Konva绘制圆环旋转动画</title> <script src="...
import { defineConfig } from 'vite'; import reactRefresh from '@vitejs/plugin-react-refresh'; import vitePluginImp...
formatter: (params: any) => { console.log(params); var relVal = params[0].name; f...
export function fontSize(res: number) { let docEl = document.documentElement, clientWidth = window.innerWidth || docum...
tooltip: { trigger: 'axis', formatter: function (params) { var res = `${params[0].name} <br/>` for (const item...
第一步:vite.config.tsimport { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import path from &#...
const customRequest = async (option: any) => { const formData = new FormData(); const type = option.file.type; ...
用来上传用户的头像,由于图片比较小,所以使用base64方式存储。 const beforeUpload = async (file: RcFile) => { const { size }...