config-tab.vue 680 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <div class="config-tab" :class="{'config-tab--active':isActive}" @click="emitClick">
  3. <slot></slot>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. name: String,
  10. isActive: Boolean
  11. },
  12. emits: ['onClick'],
  13. setup (props, { emit }) {
  14. const emitClick = () => {
  15. emit('onClick', props.name)
  16. }
  17. return {
  18. emitClick
  19. }
  20. }
  21. }
  22. </script>
  23. <style lang="less">
  24. .config-tab{
  25. flex-grow: 1;
  26. display: flex;
  27. align-items: center;
  28. justify-content: center;
  29. cursor: pointer;
  30. font-size: 14px;
  31. font-weight: 400;
  32. border-bottom: 3px solid transparent;
  33. &.config-tab--active{
  34. border-bottom-color: @primary;
  35. }
  36. }
  37. </style>