-
Notifications
You must be signed in to change notification settings - Fork 515
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
feat(Table): emit expand
event
#2063
Conversation
if (openedRows.value.includes(index)) { | ||
openedRows.value = openedRows.value.filter((i) => i !== index) | ||
} else { | ||
openedRows.value.push(index) | ||
emit('update:expand', { expandedRows: openedRows.value, row }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be emitted in both case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it? I think it could be either emitted in both cases and the information whether it was an "expand" or "collapse" could be added as a function parameter to the user or there could be another emit like update:collapse
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you send the openedRows
in the event, we should emit each time the openedRows.value
changes I guess.
expand
eventexpand
event
if (openedRows.value.includes(index)) { | ||
openedRows.value = openedRows.value.filter((i) => i !== index) | ||
} else { | ||
openedRows.value.push(index) | ||
emit('update:expand', { expandedRows: openedRows.value, row }) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (openedRows.value.includes(index)) { | |
openedRows.value = openedRows.value.filter((i) => i !== index) | |
} else { | |
openedRows.value.push(index) | |
emit('update:expand', { expandedRows: openedRows.value, row }) | |
} | |
if (openedRows.value.includes(index)) { | |
openedRows.value = openedRows.value.filter((i) => i !== index) | |
} else { | |
openedRows.value.push(index) | |
} | |
emit('update:expand', { expandedRows: openedRows.value, row }) |
Would you mind fix the conflicts? |
Closing in favor of #2485. |
π Linked issue
Resolves #2062
β Type of change
π Description
Emitting an event when a row is expanded. Useful for e.g. fetching data before the row is expanded.
π Checklist