mirror of
https://github.com/flarum/framework.git
synced 2025-04-13 22:56:37 +08:00
Allow string primitives to be added to ItemLists
This commit is contained in:
parent
bb7d51440c
commit
616d3e30ee
@ -50,6 +50,10 @@ export default class ItemList {
|
||||
|
||||
for (const i in this) {
|
||||
if (this.hasOwnProperty(i) && this[i] instanceof Item) {
|
||||
if (typeof this[i].content === 'string') {
|
||||
this[i].content = new String(this[i].content);
|
||||
}
|
||||
|
||||
this[i].content.itemName = i;
|
||||
items.push(this[i]);
|
||||
this[i].key = items.length;
|
||||
|
Loading…
x
Reference in New Issue
Block a user