会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
卢老师不想编程
博客园
首页
新随笔
联系
订阅
管理
2024年6月
前端大文件分断上传
摘要: function upload() { const fileInput = document.getElementById('fileInput'); const file = fileInput.files[0]; const chunkSize = 1024 * 1024; // 每个分片的大小
阅读全文
posted @ 2024-06-14 10:16 卢老师不想编程
阅读(30)
评论(0)
推荐(0)
2024年4月
h5使用原生麦克风
摘要: const startButton = document.getElementById('chart_button'); const inputText = document.getElementById('chatui_input'); // init recognition const reco
阅读全文
posted @ 2024-04-26 12:01 卢老师不想编程
阅读(166)
评论(0)
推荐(0)
使用pyppeteer 下载chromium 报错 python pyppeteer 调用谷歌翻译api
摘要: https://registry.npmmirror.com/binary.html?path=chromium-browser-snapshots/Win_x64/ 手动下载安装包 修改文件 C:\Users\luyan\AppData\Local\Programs\Python\Python31
阅读全文
posted @ 2024-04-22 16:50 卢老师不想编程
阅读(359)
评论(0)
推荐(0)
puppeteer 调用谷歌翻译api
摘要: npm i puppeteer index.js const puppeteer = require('puppeteer'); async function translateText(text, sl, tl) { const browser = await puppeteer.launch()
阅读全文
posted @ 2024-04-22 14:39 卢老师不想编程
阅读(59)
评论(0)
推荐(0)
nodejs 将excel 转CSV 再转json文件 整理数据
摘要: const XLSX = require('xlsx'); const fs = require('fs'); const workbook = XLSX.readFile('base.xlsx'); const sheetName = workbook.SheetNames[0]; const w
阅读全文
posted @ 2024-04-19 08:59 卢老师不想编程
阅读(31)
评论(0)
推荐(0)
2024年3月
监听 iframe 加载完成 react
摘要: iframe.addEventListener('load', function () { do something }); REACT const iframeRef = useRef(null); useEffect(() => { const iframe = iframeRef.curren
阅读全文
posted @ 2024-03-01 09:19 卢老师不想编程
阅读(286)
评论(0)
推荐(0)
2024年2月
iframe 使用 postMessage 传递信息,addEventListener监听返回信息,并使用removeEventListener取消监听事件
摘要: BUTTON 发送消息 selectButton.addEventListener('click', () => { iframe.contentWindow.postMessage({ event_id: "select_media", return_type: 'media' }, '*');
阅读全文
posted @ 2024-02-20 16:03 卢老师不想编程
阅读(476)
评论(0)
推荐(0)
前端项目使用多个字体
摘要: import ttf from "./assets/font/Fira_Sans/FiraSans-Regular.ttf" import ttf2 from "./assets/font/Fira_Sans/FiraSans-Thin.ttf" const setFontFamily = (doc
阅读全文
posted @ 2024-02-05 09:22 卢老师不想编程
阅读(75)
评论(0)
推荐(0)
flex布局 自适应宽高 缩放到内容高度时不再进行缩放, 需求设置最小高度超出滚动条,并隐藏滚动条
摘要: 在需要滚动的元素内部添加一层div ,并添加样式:position:absolute; 父级样式添加 position: relative;即可 <div className="pcCommon_left_top"> <div style={{position:'absolute',width:'c
阅读全文
posted @ 2024-02-05 08:49 卢老师不想编程
阅读(175)
评论(0)
推荐(0)
react 点击按钮 div隐藏显示 添加展开收起动画效果
摘要: js代码 const [collapse, setCollapse] = useState(false) const [showBack, setShowBack] = useState(false) const changeCollapse = () => { // 获取展开收起目标元素 cons
阅读全文
posted @ 2024-02-02 15:41 卢老师不想编程
阅读(334)
评论(0)
推荐(0)
下一页
公告