Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 (#2529): fix missing firstAction #2532

Merged
merged 1 commit into from
Mar 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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