tag.vue 777 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="tag-box" :style="{borderRadius:borderRadius,color:color,backgroundColor:bgColor}">
  3. {{tagName}}
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. color: {
  10. type: String,
  11. default: '',
  12. required: true
  13. },
  14. bgColor: {
  15. type: String,
  16. default: '',
  17. required: true
  18. },
  19. borderRadius: {
  20. type: String,
  21. default: '20rpx 0px 20rpx 0px',
  22. },
  23. tagName: {
  24. type: String,
  25. default: '',
  26. required: true
  27. }
  28. },
  29. data() {
  30. return {
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .tag-box {
  37. min-width: 107rpx;
  38. height: 42rpx;
  39. padding: 0 10rpx;
  40. text-align: center;
  41. line-height: 42rpx;
  42. font-size: 24rpx;
  43. font-family: PingFang SC, PingFang SC-Regular;
  44. font-weight: Regular;
  45. }
  46. </style>