dynamic-tag.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view class="tag-box">
  3. <view class="tag-box-list">
  4. <view class="data-tag" v-for="tag in list" :style="{'background':tagBg}">
  5. <!-- <image class="data-tag-img" mode="aspectFill" :src="tag.icon" ></image>-->
  6. <view class="data-tag-icon">
  7. <text class="iconfont icon-dingweixiao" v-if="tag.icon==='1'" :style="{'color':tagColor}"> &#xe87e;</text>
  8. <text class="iconfont icon-canyuhuati" v-else :style="{'color':tagColor}"> &#xe61e;</text>
  9. </view>
  10. <view class="data-tag-text sys-weight-400" :style="{'color':tagColor}">{{tag.text}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: "dynamic-tag",
  18. components: {},
  19. props: {
  20. list:{
  21. type:Array,
  22. default:[]
  23. },
  24. tagColor:{
  25. type:String,
  26. default:'#282828'
  27. },
  28. tagBg:{
  29. type:String,
  30. default:'rgba(255,255,255,0.4)'
  31. },
  32. },
  33. data() {
  34. return {}
  35. },
  36. watch: {},
  37. mounted() {
  38. },
  39. methods: {}
  40. }
  41. </script>
  42. <style scoped lang="scss">
  43. .tag-box{
  44. .tag-box-list{
  45. display: flex;
  46. flex-wrap: wrap;
  47. .data-tag{
  48. margin-top: 26rpx;
  49. margin-right: 20rpx;
  50. border-radius: 200rpx;
  51. background: rgba(255,255,255,0.4);
  52. display: flex;
  53. justify-content: center;
  54. padding: 4rpx 12rpx;
  55. .data-tag-img{
  56. width: 32rpx;
  57. height: 32rpx;
  58. margin-right: 8rpx;
  59. }
  60. .data-tag-icon{
  61. width: 32rpx;
  62. height: 32rpx;
  63. margin-right: 8rpx;
  64. text-align: center;
  65. line-height: 32rpx;
  66. text{
  67. font-size: 28rpx;
  68. line-height: 32rpx;
  69. }
  70. }
  71. .data-tag-text{
  72. font-size: 24rpx;
  73. height: 32rpx;
  74. line-height: 32rpx;
  75. }
  76. }
  77. }
  78. }
  79. </style>