Skip to content

Commit 6ffad12

Browse files
committed
mention changes to modal/stack components in vue 3 upgrade guide
related: statamic/cms#13350
1 parent 96419e4 commit 6ffad12

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

content/collections/pages/vue-2-to-3.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,36 @@ import { Input, Textarea, Combobox, Switch } from '@statamic/cms/ui'; // [tl! ++
576576
</template>
577577
```
578578

579+
## Modals and Stacks
580+
581+
Previously, you had to use `v-if` to control the "open state" of Modals and Stacks. You should now `v-model` the open state instead:
582+
583+
```vue
584+
<!-- Using v-model -->
585+
<Modal v-model:open="isModalOpen">
586+
<Stack v-model:open="isStackOpen">
587+
588+
<!-- Using a prop & event listener -->
589+
<Modal :open="isModalOpen" @update:open="modalOpenUpdated">
590+
<Stack :open="isStackOpen" @update:open="stackOpenUpdated">
591+
```
592+
593+
Alternatively, you may provide a `trigger` slot where the modal/stack will maintain the open state internally:
594+
595+
```vue
596+
<Stack>
597+
<template #trigger>
598+
<Button>Click Me!</Button>
599+
</template>
600+
</Stack>
601+
```
602+
603+
Modals and Stacks now accept `title` and `icon` props which will be used to render the modal/stack header:
604+
605+
```vue
606+
<Stack :title="__('How neat is that?')" icon="playground">
607+
```
608+
579609
## HMR and Vue Devtools
580610

581611
To use Hot Module Reloading (HMR) or the [Vue Devtools](https://devtools.vuejs.org) browser extension, you will need to publish a special "dev build" of Statamic.

0 commit comments

Comments
 (0)