Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template lang="pug">
- .collapsible
- h2.has-pointer(@click="showContent = !showContent") {{ titleText }}
- arrow(:isLeft="true" v-model="showContent")
- .wrap(v-show="showContent")
- slot
- </template>
- <script>
- export default {
- name: 'Collapsible',
- props: {
- startCollapsed: {
- type: Boolean,
- default: false
- },
- titleText: {
- type: String,
- required: true
- }
- },
- data () {
- return {
- showContent: false
- }
- },
- mounted () {
- this.showContent = !this.startCollapsed
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement