@afeefa/vue-app 0.0.305 → 0.0.306

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.
@@ -1 +1 @@
1
- 0.0.305
1
+ 0.0.306
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.305",
3
+ "version": "0.0.306",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -110,10 +110,6 @@ export default class FormFieldCategory extends Mixins(FormFieldMixin) {
110
110
  })
111
111
  }
112
112
 
113
- mounted () {
114
-
115
- }
116
-
117
113
  add (category) {
118
114
  if (this.isMultiple) {
119
115
  this.remove(category) // add again at end
@@ -154,23 +150,27 @@ export default class FormFieldCategory extends Mixins(FormFieldMixin) {
154
150
  }
155
151
 
156
152
  initCategories (models) {
157
- this.categories_ = models.map(m => {
158
- let children = this.getChildren(m).map(c => ({
159
- ...c,
160
- color: this.color
161
- }))
162
-
163
- if (children.length === 1) {
164
- m = children[0]
165
- children = []
166
- }
153
+ this.categories_ = models.map(m => this.initChildren(m))
154
+ }
167
155
 
168
- return {
169
- ...m,
170
- color: this.color,
171
- children
172
- }
173
- })
156
+ initChildren (model) {
157
+ let children = this.getChildren(model).map(c => ({
158
+ ...c,
159
+ color: this.color
160
+ }))
161
+
162
+ if (children.length === 1) {
163
+ model = children[0]
164
+ children = []
165
+ }
166
+
167
+ children = children.map(c => this.initChildren(c))
168
+
169
+ return {
170
+ ...model,
171
+ color: this.color,
172
+ children
173
+ }
174
174
  }
175
175
 
176
176
  get maxItems () {