Advertisement
SouldrinK

collapsible.vue

Mar 25th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <template lang="pug">
  2. .collapsible
  3. h2.has-pointer(@click="showContent = !showContent") {{ titleText }}
  4. arrow(:isLeft="true" v-model="showContent")
  5. .wrap(v-show="showContent")
  6. slot
  7. </template>
  8.  
  9. <script>
  10. export default {
  11. name: 'Collapsible',
  12. props: {
  13. startCollapsed: {
  14. type: Boolean,
  15. default: false
  16. },
  17. titleText: {
  18. type: String,
  19. required: true
  20. }
  21. },
  22. data () {
  23. return {
  24. showContent: false
  25. }
  26. },
  27. mounted () {
  28. this.showContent = !this.startCollapsed
  29. }
  30. }
  31. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement