获得徽章 7
- 赞过52
- Vibe Coding在网页特效上感觉已经为所欲为了!内容在视频里,欢迎各位道友交流 vibe coding技巧~~等人赞过评论6
- 0 基础复刻 awwwards 网页顶级特效!😀
我完全没有 three.js 基础,但我知道怎么问 ai,以下是效果。欢迎加入动效源码分享社区!
在线网址:interview.frontlight.tech
展开赞过62 - 请教一个react优化问题,我们可以在shouldComponentUpdate中这样比较来避免重新渲染数据吗?比如我们通过JSON.stringify(),比较state数据
shouldComponentUpdate(nextProps, nextState) {
if(JSON.stringify(nextState) == JSON.stringify(this.state)){
return false
}
return true
}展开赞过393 - # 每天一道前端面试题 # 考察promise和setTimeout执行顺序,请问以下输出什么
const promise = new Promise((resolve, reject) => {
console.log(1)
resolve()
console.log(2)
})
promise.then(() => {
console.log(3)
})
setTimeout(()=>{
console.log(5)
}, 0)
console.log(4)
答案: 1, 2, 4, 3, 5, 原因是Promise new的时候会立即执行里面的代码 .then里面的是微任务,是异步,会等同步任务执行完再执行, setTimeout是宏任务 也是异步,但它在微任务之后执行展开赞过22
,效果如下图,欢迎在线把玩(在线地址: