teleport per spostare il dialog in una posizione consona nel DOM
| | |
| | | <template> |
| | | <div @click="$emit('close')"></div> |
| | | <dialog open> |
| | | <header> |
| | | <slot name="header"> |
| | | <h2>{{ title }}</h2> |
| | | </slot> |
| | | </header> |
| | | <section> |
| | | <slot></slot> |
| | | </section> |
| | | <menu> |
| | | <slot name="action"> |
| | | <base-button @click="$emit('close')"></base-button> |
| | | </slot> |
| | | </menu> |
| | | </dialog> |
| | | <teleport to="body"> |
| | | <div @click="$emit('close')"></div> |
| | | <dialog open> |
| | | <header> |
| | | <slot name="header"> |
| | | <h2>{{ title }}</h2> |
| | | </slot> |
| | | </header> |
| | | <section> |
| | | <slot></slot> |
| | | </section> |
| | | <menu> |
| | | <slot name="action"> |
| | | <base-button @click="$emit('close')"></base-button> |
| | | </slot> |
| | | </menu> |
| | | </dialog> |
| | | </teleport> |
| | | </template> |
| | | |
| | | <script> |