wx-mini-weview
Version:
weixin UI
42 lines (35 loc) • 700 B
JavaScript
const { WvComponentEvent } = require('../../behaviors/WvComponentEvent');
Component({
options: {
styleIsolation: 'shared',
virtualHost: true
},
behaviors: [
WvComponentEvent
],
properties: {},
data: {},
lifetimes: {},
methods: {
handleEvent(e) {
const eventType = e.type;
const detail = {
...e.detail,
originalEvent: e,
currentTarget: {
id: e.currentTarget.id,
dataset: e.currentTarget.dataset
},
target: {
id: e.target.id,
dataset: e.target.dataset
}
};
this.triggerEvent(eventType, detail, {
bubbles: true,
composed: true,
capturePhase: false
});
}
}
});