tab-panel.vue 662 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div class="cube-tab-panel">
  3. <slot>
  4. </slot>
  5. </div>
  6. </template>
  7. <script type="text/ecmascript-6">
  8. const COMPONENT_NAME = 'cube-tab-panel'
  9. export default {
  10. name: COMPONENT_NAME,
  11. props: {
  12. label: {
  13. type: [String, Number],
  14. required: true
  15. },
  16. value: {
  17. type: [String, Number],
  18. default() {
  19. return this.label
  20. }
  21. }
  22. },
  23. mounted () {
  24. this.$parent.addPanel(this)
  25. },
  26. destroyed () {
  27. this.$parent.removePanel(this)
  28. }
  29. }
  30. </script>
  31. <style lang="stylus" rel="stylesheet/stylus">
  32. .cube-tab-panel
  33. width: 100%
  34. flex: 1 0 auto
  35. </style>