t-level-tag.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <a
  3. @click="clickItem($event)"
  4. href="/frontend/skill_cert/profile"
  5. target="view_window"
  6. :style="{
  7. width: width + 'px',
  8. height: height + 'px'
  9. }"
  10. class="t-user-level"
  11. :class="'t-level-' + level"
  12. ></a>
  13. </template>
  14. <script>
  15. export default {
  16. props: {
  17. level: {
  18. default: 0,
  19. type: Number
  20. },
  21. width: {
  22. default: 26,
  23. type: Number
  24. },
  25. height: {
  26. default: 15,
  27. type: Number
  28. },
  29. isLink:{
  30. type:Boolean,
  31. default:false
  32. }
  33. },
  34. methods:{
  35. clickItem(e){
  36. if(!this.isLink) {
  37. // debugger
  38. // e.stopPropagation();
  39. e.preventDefault()
  40. return false
  41. }
  42. }
  43. }
  44. };
  45. </script>
  46. <style lang="scss" scoped>
  47. @for $i from 1 through 7 {
  48. .t-level-#{$i} {
  49. background-image: url("~@/assets/img/t_level/T#{$i}@3x.png");
  50. }
  51. }
  52. .t-user-level {
  53. width: 26px;
  54. height: 15px;
  55. display: inline-block;
  56. background-size: 100% auto;
  57. background-position: 50% 50%;
  58. background-repeat: no-repeat;
  59. background-size: cover;
  60. vertical-align: baseline;
  61. }
  62. </style>