table element

This commit is contained in:
2026-02-07 23:50:37 +01:00
parent 937b05c362
commit 2a227f4b7f
2 changed files with 7 additions and 1 deletions

View File

@@ -1 +1 @@
1.2.70 1.2.71

View File

@@ -146,12 +146,18 @@
model: BaseModel.extend({ model: BaseModel.extend({
initialize(props = {}, opts = {}) { initialize(props = {}, opts = {}) {
// Guard before base init: grapes expects classes to be iterable in getAttributes // Guard before base init: grapes expects classes to be iterable in getAttributes
if (props && props.classes && typeof props.classes.forEach !== 'function') {
props.classes = [];
}
if (!this.classes || typeof this.classes.forEach !== 'function') { if (!this.classes || typeof this.classes.forEach !== 'function') {
this.classes = []; this.classes = [];
} }
if (BaseModel.prototype.initialize) { if (BaseModel.prototype.initialize) {
BaseModel.prototype.initialize.apply(this, [props, opts]); BaseModel.prototype.initialize.apply(this, [props, opts]);
} }
if (!this.classes || typeof this.classes.forEach !== 'function') {
this.classes = [];
}
const attrs = this.getAttributes ? this.getAttributes() : {}; const attrs = this.getAttributes ? this.getAttributes() : {};
const nextAttrs = Object.assign({ const nextAttrs = Object.assign({
'data-bridge-table': '1', 'data-bridge-table': '1',