Fixed #1483 - Add appendTo property to Dialog
parent
bc19f7f587
commit
652725016d
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Teleport to="body">
|
||||
<Teleport :to="appendTarget" :disabled="appendDisabled">
|
||||
<div :ref="maskRef" :class="maskClass" v-if="containerVisible" @click="onMaskClick">
|
||||
<transition name="p-dialog" @before-enter="onBeforeEnter" @enter="onEnter" @before-leave="onBeforeLeave" @leave="onLeave" @after-leave="onAfterLeave" appear>
|
||||
<div :ref="containerRef" :class="dialogClass" v-if="visible" v-bind="$attrs" role="dialog" :aria-labelledby="ariaLabelledById" :aria-modal="modal">
|
||||
|
@ -93,6 +93,10 @@ export default {
|
|||
minY: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
appendTo: {
|
||||
type: String,
|
||||
default: 'body'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -399,6 +403,12 @@ export default {
|
|||
},
|
||||
contentStyleClass() {
|
||||
return ['p-dialog-content', this.contentClass];
|
||||
},
|
||||
appendDisabled() {
|
||||
return this.appendTo === 'self';
|
||||
},
|
||||
appendTarget() {
|
||||
return this.appendDisabled ? null : this.appendTo;
|
||||
}
|
||||
},
|
||||
directives: {
|
||||
|
|
Loading…
Reference in New Issue