pull/132/head
cagataycivici 2019-12-09 17:48:23 +03:00
parent aa4ac46411
commit 93845f6a0c
1 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<transition name="p-dialog" @enter="onEnter" @leave="onLeave" @appear="onEnter"> <transition name="p-dialog" @enter="onEnter" @leave="onLeave" @appear="onAppear">
<div ref="container" :class="containerClass" v-if="visible"> <div ref="container" :class="containerClass" v-if="visible">
<div class="p-dialog-titlebar" v-if="showHeader"> <div class="p-dialog-titlebar" v-if="showHeader">
<slot name="header"> <slot name="header">
@ -78,6 +78,11 @@ export default {
this.disableModality(); this.disableModality();
} }
}, },
onAppear() {
if (this.visible) {
this.onEnter();
}
},
focus() { focus() {
let focusable = DomHandler.findSingle(this.$refs.container, 'input,button'); let focusable = DomHandler.findSingle(this.$refs.container, 'input,button');
if (focusable) { if (focusable) {