brandList.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="brand-list">
  3. <div class="brand-list-content">
  4. <div class="brand-list-top">
  5. <span>品牌墙</span>
  6. <span @click="onclick()">展开<i class="iconfont icon-arrow-down"></i></span>
  7. </div>
  8. <div class="brand-list-item" :style="isShow?'max-height:2.1rem;':'min-height:2.1rem;'" >
  9. <div v-for="item in brandList">
  10. <nuxt-link to="/">
  11. <img :src="item.logoUrl ||'/images/component/default.png'"/>
  12. </nuxt-link>
  13. </div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'brandList',
  21. data () {
  22. return {
  23. isShow: true
  24. }
  25. },
  26. computed: {
  27. brandList () {
  28. return this.$store.state.searchData.searchBrands.brands.data
  29. }
  30. },
  31. methods: {
  32. onclick () {
  33. this.isShow = !this.isShow
  34. }
  35. }
  36. }
  37. </script>
  38. <style scoped lang="scss">
  39. .brand-list{
  40. width:100%;
  41. .brand-list-content{
  42. margin:0 auto;
  43. border-top:.02rem solid #dedfdf;
  44. border-bottom:.02rem solid #dedfdf;
  45. width:7.1rem;
  46. min-height:3.02rem;
  47. overflow: hidden;
  48. text-align: center;
  49. padding-top:.33rem;
  50. padding-bottom:.33rem;
  51. .brand-list-top{
  52. span:first-child{
  53. font-size:.32rem;
  54. margin-right:4.78rem;
  55. }
  56. span:last-child{
  57. font-size:.28rem;
  58. color:#53a0f7;
  59. }
  60. }
  61. .brand-list-item{
  62. justify-content: space-between;
  63. flex-wrap: wrap;
  64. display:inline-flex;
  65. overflow: hidden;
  66. margin:0 .2rem;
  67. img{
  68. width:1.57rem;
  69. height:.77rem;
  70. margin-top:.2rem;
  71. border-radius: .1rem;
  72. border:.02rem solid #53a0f7;
  73. }
  74. }
  75. }
  76. }
  77. </style>