Skip to content

Commit

Permalink
Merge pull request #2532 from nextcloud/feature/fix-2529
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Mar 3, 2022
2 parents 8caab6d + 67cdcac commit 8fdc0d2
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/components/Actions/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export default {
// By binding this here, vuejs will track the object content
// Needed for firstAction reactivity !!!
children: this.$children,
firstAction: {},
}
},
Expand Down Expand Up @@ -399,18 +400,6 @@ export default {
firstActionVNode() {
return this.actions[0]
},
/**
* Reactive binding to the first children
* Since we're here, it means we already passed all the proper checks
* we can assume the first action is the first children too
* @returns {Object} first action vue children object
*/
firstAction() {
return this.children[0]
? this.children[0]
: {}
},
/**
* Binding of the first action to the template
* @returns {Object} vue template v-bind shortcut
Expand Down Expand Up @@ -482,6 +471,18 @@ export default {
this.opened = state
},
/**
* Reactive binding to the first children
* Since we're here, it means we already passed all the proper checks
* we can assume the first action is the first children too
*/
children() {
// Fix #2529, slots maybe not available on creation lifecycle
// first action vue children object
this.firstAction = this.children[0]
? this.children[0]
: {}
},
},
beforeMount() {
// init actions
Expand Down

0 comments on commit 8fdc0d2

Please sign in to comment.