chore: Improve SUI Component element manipulation methods and add empty expression helper

This commit is contained in:
Max 2024-08-07 15:52:58 +08:00
parent 252e1793ac
commit ae5e60aefa
2 changed files with 75 additions and 60 deletions

File diff suppressed because one or more lines are too long

View file

@ -106,6 +106,21 @@ function __sui_component(elm, component) {
this.store = new __sui_store(elm);
this.props = new __sui_props(elm);
this.state = component ? new __sui_state(component) : {};
const __self = this;
this.$root = new __Query(this.root);
this.find = function (selector) {
return new __Query(__self.root).find(selector);
};
this.query = function (selector) {
return __self.root.querySelector(selector);
};
this.render = function (name, data, option) {
const r = new __Render(__self, option);
return r.Exec(name, data);
};
}
function __sui_event_handler(event, dataKeys, jsonKeys, target, root, handler) {