Update asset metadata and enhance event handling in SUI
- Updated modification times for various asset files in bindata.go to reflect recent changes. - Enhanced event handling in libsui/index.ts to support parent component names for event binding, improving flexibility and error handling.
This commit is contained in:
parent
01c524be54
commit
3b723fbce8
2 changed files with 92 additions and 85 deletions
168
data/bindata.go
168
data/bindata.go
File diff suppressed because one or more lines are too long
|
|
@ -167,7 +167,14 @@ function __sui_event_handler(event, dataKeys, jsonKeys, target, root, handler) {
|
|||
|
||||
function __sui_event_init(elm: Element) {
|
||||
const bindEvent = (eventElm) => {
|
||||
const cn = eventElm.getAttribute("s:event-cn") || "";
|
||||
let cn = eventElm.getAttribute("s:event-cn") || "";
|
||||
|
||||
// If has parent component, use the parent component name
|
||||
const parent = eventElm.closest(`[s\\:cn]`);
|
||||
if (parent) {
|
||||
cn = parent.getAttribute("s:cn") || "";
|
||||
}
|
||||
|
||||
if (cn == "") {
|
||||
console.error("[SUI] Component name is required for event binding", elm);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue