Files
vuepress/packages/@vuepress/theme-default/components/DropdownTransition.vue
ULIVZ 7f7fe18d40 feat: support clean and multiple custom layout. / theme default layouts dir
1. Refine ExtendPageDataOption, simplify the implmentation
2. Introduce LayoutDistributor as the unique route layout entry
3. Inject layout components to LayoutDistributor
4. Register layout components located at themedir/layouts
5. Reorganize the default theme's structure
2018-09-05 01:02:19 +08:00

34 lines
560 B
Vue

<template>
<transition
name="dropdown"
@enter="setHeight"
@after-enter="unsetHeight"
@before-leave="setHeight"
>
<slot/>
</transition>
</template>
<script>
export default {
name: 'DropdownTransition',
methods: {
setHeight (items) {
// explicitly set height so that it can be transitioned
items.style.height = items.scrollHeight + 'px'
},
unsetHeight (items) {
items.style.height = ''
}
}
}
</script>
<style lang="stylus">
.dropdown-enter, .dropdown-leave-to
height 0 !important
</style>