docs_vue2/one/docs/demo/overlay/stack-on-overlay.vue

70 lines
1.1 KiB
Vue
Raw Normal View History

2020-08-13 11:47:56 +08:00
<template>
<article>
<veui-button
ref="parent"
@click="parentOpen = !parentOpen"
>
Toggle
</veui-button>
<veui-overlay
target="parent"
position="top-start"
:open.sync="parentOpen"
overlay-class="relative-overlay"
>
<veui-button
ref="child"
@click="childOpen = !childOpen"
>
Toggle
</veui-button>
<veui-overlay
target="child"
position="top-start"
:open.sync="childOpen"
overlay-class="relative-overlay"
>
Child Overlay
</veui-overlay>
</veui-overlay>
<veui-button
ui="xs"
@click="parentOpen = childOpen = false"
>
Hide all
</veui-button>
</article>
</template>
<script>
import { Overlay, Button } from 'veui'
export default {
components: {
'veui-overlay': Overlay,
'veui-button': Button
},
data () {
return {
parentOpen: false,
childOpen: false
}
},
watch: {
parentOpen (val) {
if (!val) {
this.childOpen = false
}
}
}
}
</script>
<style lang="less" docs scoped>
.veui-button {
margin-right: 10px;
}
</style>
<style lang="less" src="./relative.less" docs></style>