Skip to content

Commit 1896892

Browse files
二一7insummer
authored andcommitted
fix:更新组件内事件冒泡和阻止冒泡 (#391)
1 parent 962fee4 commit 1896892

File tree

32 files changed

+50
-64
lines changed

32 files changed

+50
-64
lines changed

examples/dist/action-sheet/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Component({
8787
success
8888
} = this.data;
8989
success && success({ ...e.currentTarget.dataset });
90-
this.triggerEvent('linitemtap', { ...e.currentTarget.dataset });
90+
this.triggerEvent('linitemtap', { ...e.currentTarget.dataset },{ bubbles: true, composed: true });
9191
this._hideActionSheet();
9292
},
9393

@@ -112,7 +112,7 @@ Component({
112112
});
113113
this.triggerEvent('lincancel', {
114114
errMsg: 'showactionsheet:fail cancel'
115-
});
115+
},{ bubbles: true, composed: true });
116116
this._hideActionSheet();
117117
},
118118

examples/dist/badge/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ Component({
5656
},
5757
// 点击事件
5858
handleTap() {
59-
this.triggerEvent('lintap');
60-
this.triggerEvent('lintapcatch', {}, { bubbles: true });
59+
this.triggerEvent('lintap',{},{ bubbles: true, composed: true });
6160
},
6261
}
6362
});

examples/dist/count-selector/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Component({
6767
count: this.data.count,
6868
type: 'blur'
6969
}
70-
this.triggerEvent('lintap', detail)
70+
this.triggerEvent('lintap', detail,{ bubbles: true, composed: true })
7171
},
7272

7373
reduceTap() {
@@ -84,7 +84,7 @@ Component({
8484
count: this.data.count,
8585
type: 'reduce'
8686
}
87-
this.triggerEvent('lintap', detail)
87+
this.triggerEvent('lintap', detail,{ bubbles: true, composed: true })
8888
},
8989

9090
addTap() {
@@ -101,7 +101,7 @@ Component({
101101
count: this.data.count,
102102
type: 'add'
103103
}
104-
this.triggerEvent('lintap', detail)
104+
this.triggerEvent('lintap', detail,{ bubbles: true, composed: true })
105105
},
106106
}
107107
})

examples/dist/custom-tab-bar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Component({
9090
idx,
9191
path:this.route
9292
};
93-
let option = {};
93+
let option = { bubbles: true, composed: true };
9494
this.triggerEvent('lintap', detail, option);
9595
},
9696
showRedDot(idx) {

examples/dist/dialog/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Component({
155155
onCancelTap(e) {
156156

157157
let detail = 'cancel';
158-
let option = {};
158+
let option = { bubbles: true, composed: true };
159159

160160
const {
161161
success
@@ -175,7 +175,7 @@ Component({
175175
// 背景点击事件
176176
onDialogTap(e) {
177177
let detail = true;
178-
let option = {};
178+
let option = { bubbles: true, composed: true };
179179

180180
if (this.data.locked !== true) {
181181
this.setData({

examples/dist/grid-item/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Component({
2222
tapGridItem(e) {
2323
this.triggerEvent('lintap', {
2424
...e
25-
}, {
26-
composed: true
27-
})
25+
}, { bubbles: true, composed: true })
2826
},
2927
}
3028
});

examples/dist/grid/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Component({
7070
tapGrid(e) {
7171
this.triggerEvent('lintap', {
7272
index:this.data.currentIndex
73-
})
73+
},{ bubbles: true, composed: true })
7474
}
7575
}
7676
});

examples/dist/list/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Component({
7777
}
7878
this.triggerEvent('lintap', {
7979
e
80-
}, {})
80+
}, { bubbles: true, composed: true })
8181
}
8282
}
8383
});

examples/dist/loadmore/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ Component({
3131
},
3232
methods: {
3333
onLoadmore(){
34-
this.triggerEvent('lintap');
35-
this.triggerEvent('lintapcatch',{},{ bubbles: true });
34+
this.triggerEvent('lintap',{},{ bubbles: true, composed: true });
3635
}
3736
}
3837
});

examples/dist/mask/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Component({
6464
onMaskTap(e) {
6565

6666
let detail = true;
67-
let option = {};
67+
let option = { bubbles: true, composed: true };
6868

6969
if (this.data.locked !== true) {
7070
this.setData({

0 commit comments

Comments
 (0)