소스 검색

修改点击触发2次change事件bug

haojianlong 5 년 전
부모
커밋
5b1a7e3982
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      saga-web-graph/src/SGraphSelectContainer.ts

+ 4 - 1
saga-web-graph/src/SGraphSelectContainer.ts

@@ -44,7 +44,10 @@ export class SGraphSelectContainer extends SObject {
      * @param   item    当前选中的item
      * */
     setItem(item: SGraphItem): void {
-        this.clear();
+        this.itemList.forEach((t: SGraphItem): void => {
+            t.selected = false;
+        });
+        this.itemList.length = 0;
         item.selected = true;
         this.itemList.push(item);
         this.$emit("listChange", this.itemList);