@cc-component/cc-guide 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -192,9 +192,9 @@ export class GuideViewComp extends Component {
|
|
|
192
192
|
|
|
193
193
|
} else {
|
|
194
194
|
//@ts-ignore
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
197
|
-
|
|
195
|
+
const mbutton_event = button?.onClick;//自定义事件
|
|
196
|
+
if (mbutton_event) {
|
|
197
|
+
mbutton_event.dispatch()
|
|
198
198
|
this.onClick()
|
|
199
199
|
}
|
|
200
200
|
else {
|
|
@@ -213,29 +213,35 @@ export class GuideViewComp extends Component {
|
|
|
213
213
|
const view = item.getComponent(GuideViewItem)
|
|
214
214
|
//按钮
|
|
215
215
|
let target_button = view.findButton()
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (target_button
|
|
223
|
-
|
|
216
|
+
//@ts-ignore
|
|
217
|
+
const mbutton_event = target_button?.onClick;//自定义事件
|
|
218
|
+
if (mbutton_event) {
|
|
219
|
+
mbutton_event.dispatch()
|
|
220
|
+
} else {
|
|
221
|
+
const clickEvents = target_button?.clickEvents ?? [];
|
|
222
|
+
if (target_button?.interactable) {
|
|
223
|
+
clickEvents.forEach((e, index) => { e.emit([event]); });
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (target_toggle_container && target_toggle) {
|
|
231
|
-
target_toggle_container?.checkEvents.forEach(event => {
|
|
232
|
-
if (target_toggle.interactable)
|
|
233
|
-
event.emit([target_toggle]);
|
|
234
|
-
})
|
|
235
|
-
} else {
|
|
236
|
-
btn.dispatchEvent(event)
|
|
225
|
+
//解决用node.on("click") 监听的事件
|
|
226
|
+
if (target_button && clickEvents.length <= 0) {
|
|
227
|
+
if (target_button.interactable) {
|
|
228
|
+
target_button.node.emit("click");
|
|
229
|
+
}
|
|
237
230
|
}
|
|
231
|
+
else {
|
|
232
|
+
//toggle组件
|
|
233
|
+
const target_toggle = view.findToggle()
|
|
234
|
+
const target_toggle_container = view.findToggleContainer()
|
|
235
|
+
if (target_toggle_container && target_toggle) {
|
|
236
|
+
target_toggle_container?.checkEvents.forEach(event => {
|
|
237
|
+
if (target_toggle.interactable)
|
|
238
|
+
event.emit([target_toggle]);
|
|
239
|
+
})
|
|
240
|
+
} else {
|
|
241
|
+
btn.dispatchEvent(event)
|
|
242
|
+
}
|
|
238
243
|
|
|
244
|
+
}
|
|
239
245
|
}
|
|
240
246
|
}
|
|
241
247
|
this.onClick()
|