feat: 优化代码,使用 Array.includes 代替 || (#1115)

* fix: 修复 mouseup 失效

* feat: 优化 pickingService 的节流操作

* style: lint style
This commit is contained in:
YiQianYao 2022-05-18 10:30:39 +08:00 committed by GitHub
parent db1940be1f
commit 29d7715000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -213,9 +213,7 @@ export default class PickingService implements IPickingService {
// TODO: 优化拾取操作 在右键时 mousedown 和 contextmenu 几乎同时触发,所以不能舍去这一次的触发
if (
t - this.lastPickTime > 10 ||
target.type === 'contextmenu' ||
target.type === 'click' ||
target.type === 'mouseup'
['contextmenu', 'click', 'mouseup'].includes(target.type)
) {
await this.pickingLayers(target);
}