editHomeApply.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="home-apply">
  3. <view class="home-apply-title">
  4. 首页应用
  5. </view>
  6. <view class="home-edit">
  7. <view class="home-edit-item" v-for="(item,index) in homeList" :key="index">
  8. <view class="home-edit-item-img">
  9. <image style="width: 100%;height: 100%;" :src="item.img" mode=""></image>
  10. <view class="home-edit-item-img-icon" @click="decrease(item)">
  11. -
  12. </view>
  13. </view>
  14. <view class="home-edit-item-text">
  15. {{item.title}}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. name: "editHomeApply",
  24. props: {
  25. list: {
  26. type: Array,
  27. default: () => []
  28. }
  29. },
  30. data() {
  31. return {
  32. };
  33. },
  34. methods: {
  35. decrease(item) {
  36. item.show = !item.show
  37. this.$emit('update:list',this.list)
  38. }
  39. },
  40. computed: {
  41. homeList() {
  42. let arr = []
  43. this.list.forEach(item => {
  44. item.childer.forEach(item1 => {
  45. if (item1.show) {
  46. arr.push(item1)
  47. }
  48. })
  49. })
  50. return arr
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss">
  56. .home-apply {
  57. padding: 32rpx;
  58. background-color: #fff;
  59. border-radius: 5.33px;
  60. box-shadow: 0px 0px 6.67px 0px rgba(147, 147, 147, 0.20);
  61. }
  62. .home-apply-title {
  63. margin-bottom: 32rpx;
  64. font-size: 32rpx;
  65. }
  66. .home-edit {
  67. width: 100%;
  68. display: flex;
  69. .home-edit-item {
  70. width: 20%;
  71. display: flex;
  72. flex-direction: column;
  73. justify-content: center;
  74. align-items: center;
  75. font-size: 24rpx;
  76. }
  77. }
  78. .home-edit-item-img {
  79. width: 50rpx;
  80. height: 50rpx;
  81. position: relative;
  82. .home-edit-item-img-icon {
  83. width: 30rpx;
  84. height: 30rpx;
  85. background-color: rgba(153, 153, 153, 1);
  86. font-size: 24rpx;
  87. color: #fff;
  88. text-align: center;
  89. line-height: 30rpx;
  90. border-radius: 50%;
  91. position: absolute;
  92. right: -15rpx;
  93. top: -15rpx;
  94. }
  95. }
  96. </style>