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 { Form, Progress } from "antd"; import React from "react"; import "./index.less"; //CharMode函数 //测试某个字符是属于哪一类. const CharMode = (iN: number) =...
hi!今天给各位记录一下在unapp中,当有界面需要横屏显示的时候,在默认开发模式下,是正常的,但打包API后,就不能横屏或者竖屏了。很简单的两步配置:一:打开manifest.json...
const map = new Map({ basemap: baseMap, ground: { surfaceColor: '#1b2540', opacity: 1 } });
计算距离const calculateDistance = (x1: number, y1: number, x2: number, y2: number) => { const dx = x2 - x1; const dy = y2 - y1; const distance = Math.s...
请求方法:POST,为了安全起见,所有接口都需加token验证,如果您的网站不需要验证token,或者不想这么麻烦,您可自行将接口文件的construct方法注释掉即可。 返回数据字段说...
配置文件import CopyWebpackPlugin from "copy-webpack-plugin"; import { DefinePlugin } from "webpack"; import path from "path"; export default { // Disable server...
centos6中使用的是iptables,之前写过一篇文章,在centos7中禁用firewall开启iptables,这次记录下centos7中firewall如何开启端口1、查看防火墙状态,及端口列表firewall-cmd --st...
ffmpeg安装官网 https://www.ffmpeg.org/download.html#build-windows下载后解压,并且配置环境变量打开cmd输入ffmpeg -h
const RTSP2web = require('rtsp2web') // 服务端长连接占据的端口号;端口号可以自定义 const port = 9999 new RTSP2web({ port })下载ffmpeghttps://ffmpeg.or...
Nginx 配置反向代理去除前缀1. 地址后面加/ server { location ^~/v1/ { proxy_pass http://localhost:8080/; } }^~/v1/表示请...
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/...