config-tab.vue 839 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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: 2px solid transparent;
  33. &.config-tab--active{
  34. //background: @primary;
  35. //color: #fff;
  36. border-bottom-color: @primary;
  37. }
  38. //&:hover{
  39. // background: @primary;
  40. // color: #fff;
  41. //}
  42. &+&{
  43. //border-left: 1px solid #ddd;
  44. }
  45. }
  46. </style>