forked from vuejs/vuepress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tweak: ensure that all the dropdown's style are consistent (vuejs#156)
- Loading branch information
Showing
5 changed files
with
69 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<transition name="dropdown" | ||
@enter="setHeight" | ||
@after-enter="unsetHeight" | ||
@before-leave="setHeight"> | ||
<slot></slot> | ||
</transition> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'SidebarGroup', | ||
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters