lesson 135: move the teleport tag to the BaseDialog
This commit is contained in:
parent
cf78b35666
commit
8c310f17c2
|
@ -1,18 +1,20 @@
|
|||
<template>
|
||||
<div @click="$emit('close')"></div>
|
||||
<dialog open>
|
||||
<header>
|
||||
<slot name="header">
|
||||
<h2>{{ title }}</h2>
|
||||
</slot>
|
||||
</header>
|
||||
<section><slot name="default"></slot></section>
|
||||
<menu
|
||||
><slot name="actions">
|
||||
<base-button @click="$emit('close')">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 name="default"></slot></section>
|
||||
<menu
|
||||
><slot name="actions">
|
||||
<base-button @click="$emit('close')">Close</base-button>
|
||||
</slot></menu
|
||||
>
|
||||
</dialog>
|
||||
</teleport>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
|
|
@ -23,21 +23,19 @@
|
|||
</div>
|
||||
</form>
|
||||
</base-card>
|
||||
<teleport to="body">
|
||||
<base-dialog
|
||||
v-if="inputIsInvalid"
|
||||
title="Input may not be empty"
|
||||
@close="resetErrorDialog"
|
||||
>
|
||||
<template #default>
|
||||
<p>Unfortunately some inputs seem to be empty.</p>
|
||||
<p>Please correct this and try again.</p>
|
||||
</template>
|
||||
<template #actions>
|
||||
<base-button @click="resetErrorDialog">Ok</base-button>
|
||||
</template>
|
||||
</base-dialog>
|
||||
</teleport>
|
||||
<base-dialog
|
||||
v-if="inputIsInvalid"
|
||||
title="Input may not be empty"
|
||||
@close="resetErrorDialog"
|
||||
>
|
||||
<template #default>
|
||||
<p>Unfortunately some inputs seem to be empty.</p>
|
||||
<p>Please correct this and try again.</p>
|
||||
</template>
|
||||
<template #actions>
|
||||
<base-button @click="resetErrorDialog">Ok</base-button>
|
||||
</template>
|
||||
</base-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
Reference in New Issue