index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class="listtopb flexc" >
  3. <block v-for="(ite,idx) in tablist" :key='idx'>
  4. <view class="tit" :style="'height:'+height+'rpx'" :class="tabval==ite.dictValue?'act':''" @click="getTab(ite.dictValue)" >
  5. {{ite.dictLabel}}
  6. </view>
  7. </block>
  8. </view>
  9. </template>
  10. <script>
  11. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  12. export default{
  13. props:{
  14. tablist:{
  15. type: Array,
  16. default () {
  17. return []
  18. }
  19. },
  20. height:{
  21. type: Number,
  22. default () {
  23. return 80
  24. }
  25. },
  26. tabval:{
  27. type: [String,Number],
  28. default () {
  29. return ''
  30. }
  31. }
  32. },
  33. data(){
  34. return{
  35. // :0,
  36. }
  37. },
  38. mounted() {
  39. },
  40. methods:{
  41. checkPermi, checkRole,
  42. getTab(val){
  43. this.$emit('getCheck',val)
  44. },
  45. getroleFn(){
  46. this.$emit('getroleFn')
  47. },
  48. }
  49. }
  50. </script>
  51. <style lang="scss">
  52. .listtopb{width: 100%;overflow: auto;
  53. .tit{display: flex;justify-content: center;position: relative;align-items: center;
  54. font-weight: 500;font-size: 30rpx;color: #626669;height: 80rpx;padding: 0 26rpx;
  55. &.act{font-weight: bold;font-size: 34rpx;color: #161A1E;
  56. &::after{content: '';width: 36rpx;height: 6rpx;background: #0053FF;
  57. border-radius: 4rpx;position: absolute;left: 50%;margin-left: -17rpx;bottom: 0rpx;}
  58. }
  59. }
  60. }
  61. </style>