10 2024 档案
摘要:监听事件 ThreeDom.current.addEventListener('mousemove', mousemoveFunc, false); 监听方法 const mousemoveFunc = (event) => { event.preventDefault(); // 计算鼠标在屏幕上
阅读全文
摘要:sceneRef.current.addEventListener('click', clickFunc, false); sceneRef.current.addEventListener('dblclick', dblclickFunc, false); sceneRef.current.add
阅读全文
摘要:超出自动换行: function drawWrappedText(ctx, text, x, y, maxWidth, lineHeight) { let words = text.split(' '); let line = ''; for (let i = 0; i < words.length
阅读全文
摘要:1.编码与解码 encodeURIComponent 和 decodeURIComponent 是 JavaScript 中的两个内置函数,用于处理 URL 编码和解码。它们主要用于在 URL 中传递数据时,确保特殊字符不影响 URL 的结构。 1. encodeURIComponent 作用: 将
阅读全文