Skip to content

Commit 6d42b45

Browse files
committed
Update accordion and details v-model docs
1 parent d60bb89 commit 6d42b45

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

.generated-examples/content2componentsaccordionExample1.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ const sectionCIsOpen = ref(null)
88

99
<template>
1010
<gv-accordion>
11-
<gv-accordion-section heading="Section A - forced open" v-model="sectionAIsOpen">
11+
<gv-accordion-section heading="Section A - forced open" v-model:expanded="sectionAIsOpen">
1212
<p class="govuk-body">This section is forced to be open when first loaded.</p>
1313
</gv-accordion-section>
14-
<gv-accordion-section heading="Section B - forced closed" v-model="sectionBIsOpen">
14+
<gv-accordion-section heading="Section B - forced closed" v-model:expanded="sectionBIsOpen">
1515
<p class="govuk-body">This section is forced to be closed when first loaded</p>
1616
</gv-accordion-section>
17-
<gv-accordion-section heading="Section C - default state" v-model="sectionCIsOpen">
17+
<gv-accordion-section heading="Section C - default state" v-model:expanded="sectionCIsOpen">
1818
<p class="govuk-body">This section has no forced state, so defaults to closed</p>
1919
</gv-accordion-section>
2020
</gv-accordion>

.generated-examples/content2componentsdetailsExample1.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const isOpen = ref(true)
55
</script>
66

77
<template>
8-
<gv-details summary="Help with nationality" v-model="isOpen">
8+
<gv-details summary="Help with nationality" v-model:open="isOpen">
99
<p class="govuk-body">
1010
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you cannot
1111
provide your nationality, you’ll have to send copies of identity documents through the post.
1212
</p>
1313
</gv-details>
1414
<gv-inset-text aria-live="polite">
15-
<p class="govuk-body">Value of v-model: {{isOpen}}</p>
15+
<p class="govuk-body">Value of v-model:open: {{isOpen}}</p>
1616
</gv-inset-text>
1717
</template>

content/2.components/accordion.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ See the [GOV.UK Design System documentation on accordions](https://design-system
2727

2828
## Controlling which sections are open
2929

30-
By default, all sections will be closed. You can bind a boolean value with `v-model` to set and keep track of the
30+
By default, all sections will be closed. You can bind a boolean value with `v-model:expanded` to set and keep track of the
3131
open state of the accordion section.
3232

3333
You can also set `:remember-expanded="true"` on the accordion to let the browser remember which sections a user has open.
@@ -37,8 +37,8 @@ service is hosted on.
3737

3838
:gv-warning-text{text="This behaviour is different to the GOV.UK Frontend Nunjucks macros, where rememberExpanded defaults to true. This is because in GOV.UK Vue, id is optional and the expanded state can't be stored reliably if an ID is not provided."}
3939

40-
If a section has `v-model` set to `true` or `false` and `remember-expanded` is `true`, the value of `v-model` takes precedence. For example,
41-
if the stored state of a section is open but `v-model` is `false`, the section will be closed by default.
40+
If a section has `v-model:expanded` set to `true` or `false` and `remember-expanded` is `true`, the value of `v-model:expanded` takes precedence. For example,
41+
if the stored state of a section is open but `v-model:expanded` is `false`, the section will be closed by default.
4242

4343
```vue
4444
<script setup lang="ts">
@@ -51,13 +51,13 @@ const sectionCIsOpen = ref(null)
5151
5252
<template>
5353
<gv-accordion>
54-
<gv-accordion-section heading="Section A - forced open" v-model="sectionAIsOpen">
54+
<gv-accordion-section heading="Section A - forced open" v-model:expanded="sectionAIsOpen">
5555
<p class="govuk-body">This section is forced to be open when first loaded.</p>
5656
</gv-accordion-section>
57-
<gv-accordion-section heading="Section B - forced closed" v-model="sectionBIsOpen">
57+
<gv-accordion-section heading="Section B - forced closed" v-model:expanded="sectionBIsOpen">
5858
<p class="govuk-body">This section is forced to be closed when first loaded</p>
5959
</gv-accordion-section>
60-
<gv-accordion-section heading="Section C - default state" v-model="sectionCIsOpen">
60+
<gv-accordion-section heading="Section C - default state" v-model:expanded="sectionCIsOpen">
6161
<p class="govuk-body">This section has no forced state, so defaults to closed</p>
6262
</gv-accordion-section>
6363
</gv-accordion>

content/2.components/details.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ correct paragraph styling. If you use the slot, you'll need to wrap your paragra
2525

2626
## Using `v-model` with details
2727

28-
You can bind a boolean value with `v-model` to set and keep track of the open state of the details element.
28+
You can bind a boolean value with `v-model:open` to set and keep track of the open state of the details element.
2929

3030
```vue
3131
<script setup lang="ts">
@@ -35,14 +35,14 @@ const isOpen = ref(true)
3535
</script>
3636
3737
<template>
38-
<gv-details summary="Help with nationality" v-model="isOpen">
38+
<gv-details summary="Help with nationality" v-model:open="isOpen">
3939
<p class="govuk-body">
4040
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you cannot
4141
provide your nationality, you’ll have to send copies of identity documents through the post.
4242
</p>
4343
</gv-details>
4444
<gv-inset-text aria-live="polite">
45-
<p class="govuk-body">Value of v-model: {{isOpen}}</p>
45+
<p class="govuk-body">Value of v-model:open: {{isOpen}}</p>
4646
</gv-inset-text>
4747
</template>
4848
```

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"vue-docgen-cli": "^4.67.0"
1515
},
1616
"dependencies": {
17-
"govuk-vue": "1.0.0-alpha.24"
17+
"govuk-vue": "1.0.0-alpha.25"
1818
}
1919
}

0 commit comments

Comments
 (0)