You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SummaryBar.vue 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template lang="pug">
  2. section.w-flex.column.pb5
  3. nav.fill-width.w-flex.column.justify-space-between
  4. // Tabbed Layout
  5. w-tabs(
  6. :items='Object.keys(tabContent)'
  7. @input='onTabChanged'
  8. center
  9. fill-bar
  10. v-if='isTab'
  11. )
  12. template(#item-title='{ item }')
  13. .w-flex.column.justify-start
  14. p(v-if='tabContent[item].matchPerc') {{ tabContent[item].matchPerc }}%
  15. p(v-else) &nbsp;
  16. p {{ item }}
  17. // About Tab
  18. template(#item-content.1='{ item }')
  19. .tab--about
  20. p {{ tabContent[item].tab }}
  21. br
  22. p {{ tabContent[item].tab }}
  23. br
  24. hr
  25. // Passion Tab
  26. template(#item-content.2='{ item }')
  27. .tab--passion
  28. p {{ tabContent[item].tab }}
  29. SpiderChart(
  30. :labels='aspects.map(label => label.name)'
  31. :profile-data='profileScore'
  32. :target-data='targetScore'
  33. profile-name='lucy'
  34. v-if='isTab'
  35. )
  36. // Aspirations Tab
  37. template(#item-content.3='{ item }')
  38. .tab--aspirations
  39. p {{ tabContent[item].tab }}
  40. // Skills Tab
  41. template(#item-content.4='{ item }')
  42. .tab--skills
  43. p {{ tabContent[item].tab }}
  44. // Untabbed Layout
  45. ul.w-flex.row.justify-space-between(v-else)
  46. template(
  47. :key='index'
  48. v-for='(item, index) in Object.keys(tabContent)'
  49. )
  50. li.w-flex.row(v-if='item !== "about"')
  51. w-icon.mr1(xl) mdi mdi-heart
  52. .w-flex.column.justify-start
  53. p
  54. span {{ tabContent[item].matchPerc }}%
  55. p.text-capitalize {{ item }}
  56. </template>
  57. <script>
  58. import SpiderChart from './SpiderChart.vue'
  59. export default {
  60. components: { SpiderChart },
  61. props: {
  62. aspects: {
  63. required: true,
  64. type: Array,
  65. },
  66. tabContent: {
  67. required: true,
  68. type: Object,
  69. },
  70. isTab: {
  71. required: false,
  72. type: Boolean,
  73. default: false,
  74. },
  75. showIcon: {
  76. required: false,
  77. type: Boolean,
  78. default: true,
  79. },
  80. },
  81. emits: ['tab-change'],
  82. data: () => ({
  83. profileScore: [5.7, 5.2, 4.8, 5.2, 4.9, 4.9],
  84. targetScore: [5.3, 4.8, 5.7, 4.8, 5.6, 4.8],
  85. }),
  86. methods: {
  87. onTabChanged(tabs) {
  88. this.$emit('tab-change', tabs)
  89. },
  90. },
  91. }
  92. </script>
  93. <style lang="sass">
  94. section
  95. font-family: Century Gothic, CenturyGothic, AppleGothic, sans-serif
  96. ul
  97. margin: 11px 0
  98. li
  99. margin: 0 7px
  100. font-size: .8em
  101. p > span
  102. font-weight: bold
  103. font-size: 1em
  104. li:not(:last-child)
  105. border-right: 1px solid #fff
  106. </style>