Skip to content

Commit ecfe69a

Browse files
committed
docs: clarify how open-all-groups affects opened
1 parent 802f29d commit ecfe69a

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/api-generator/src/locale/en/DataTable-group.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"props": {
33
"groupBy": "Defines the grouping of the table items.",
44
"groupKey": "Custom function to generate group IDs. Receives `{ key, value, parentKey }` where `parentKey` is `null` for top-level groups. Useful when group values contain special characters or are non-string types.",
5-
"openAllGroups": "Opens all groups by default. Individual groups can still be toggled closed by the user.",
6-
"opened": "An array of group IDs that should be open. Supports two-way binding with `v-model:opened`.",
5+
"openAllGroups": "Opens all groups by default. Individual groups can still be toggled closed by the user and are tracked internally (not reflected in `v-model:opened`).",
6+
"opened": "An array of group IDs that should be open. Supports two-way binding with `v-model:opened`. When `open-all-groups` is `true`, this model only tracks groups the user has explicitly re-opened after closing them.",
77
"pageBy": "Controls how pagination counts items.\n- **item** paginates by individual items,\n- **auto** paginates by top-level groups and falls back to regular items if **group-by** is empty,\n- **any** paginates by both items and groups combined"
88
}
99
}

packages/docs/src/examples/v-data-iterator/prop-grouping.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<div class="d-flex ga-4 mb-4 align-center">
44
<v-switch v-model="openAll" label="Open all groups" hide-details></v-switch>
5-
<v-btn size="small" variant="tonal" @click="opened = []">Close all</v-btn>
5+
<v-btn :disabled="openAll" size="small" variant="tonal" @click="opened = []">Close all</v-btn>
66
</div>
77

88
<v-data-iterator

packages/docs/src/examples/v-data-table/prop-grouping.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<div class="d-flex ga-4 mb-4 align-center flex-wrap">
44
<v-switch v-model="openAll" label="Open all groups" hide-details></v-switch>
5-
<v-btn size="small" variant="tonal" @click="opened = []">Close all</v-btn>
5+
<v-btn :disabled="openAll" size="small" variant="tonal" @click="opened = []">Close all</v-btn>
66
</div>
77

88
<pre class="mb-4 pa-2 bg-surface-variant rounded text-body-2">opened: {{ opened }}</pre>

packages/docs/src/pages/en/components/data-iterators.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ Use the **group-by** prop to group items, and **v-model:opened** to control whic
8282

8383
<ExamplesExample file="v-data-iterator/prop-grouping" />
8484

85+
::: warning
86+
87+
When **open-all-groups** is enabled, the **v-model:opened** array does not represent the full open state — groups that the user closes are tracked separately and are not emitted through the model. Setting `opened = []` while **open-all-groups** is `true` will not collapse anything; disable **open-all-groups** first to programmatically close all groups.
88+
89+
:::
90+
8591
### Slots
8692

8793
The `v-data-iterator` component has 4 main slots

0 commit comments

Comments
 (0)