<template
>
<div
class="passwordError">
<van
-overlay
:show
="show"
@click
="clickOverlay"
>
<div
class="content" ref
="contentWrapper">
内部区域
</div
>
</van
-overlay
>
</div
>
</template
>
<script
>
export default {
data () {
return {
}
},
props
:{
visible
:{
required
:true,
type
:Boolean
,
default:false
}
},
computed
:{
show
:{
get(){
return this.visible
},
set(v
){
this.$emit('close',v
)
}
}
},
methods
:{
clickOverlay(e
){
let tree
= this.$refs
.contentWrapper
.contains(e
.target
)
if(!tree
){
this.$emit('close')
}
},
}
}
</script
>
转载请注明原文地址:https://tech.qufami.com/read-10908.html