Commit e60dca3c authored by JingChao's avatar JingChao
parents 810a3c07 43a72c19
<template> <template>
<!--<transition :name="transition">--> <!--<transition :name="transition">-->
<div v-show="showModal" :class="active" class="modal-backdrop" @touchstart="hideModal"> <div v-show="showModal" :class="active" class="modal-backdrop" @click.capture="hideModal">
<div class="modal-backdrop-bg"/> <div class="modal-backdrop-bg"/>
<div <div
:class="[modalClass,transition]" :class="[modalClass,transition]"
...@@ -77,14 +77,23 @@ export default { ...@@ -77,14 +77,23 @@ export default {
}, },
start (e) { start (e) {
e.stopPropagation() // e.stopPropagation()
}, },
hideModal () { hideModal (e) {
this.state = 3 if(!e){
setTimeout(() => { this.state = 3
this.state = 0 setTimeout(() => {
this.showModal = false this.state = 0
}, 250) this.showModal = false
}, 250)
}
if(e && e.target && e.target.className.indexOf('modal-backdrop') === 0){
this.state = 3
setTimeout(() => {
this.state = 0
this.showModal = false
}, 250)
}
}, },
}, },
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment