peopleList.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="people-list">
  3. <view @click="itemClick(item)" v-for="(item,index) in list" :key="index" class="people-list-item">
  4. <view class="">
  5. {{item.name}}
  6. </view>
  7. <view class="people-list-item-right">
  8. <view v-if="item.show" class="people-list-item-right-active">
  9. <uni-icons color='#fff' type="checkmarkempty" size="12"></uni-icons>
  10. </view>
  11. <view v-else class="people-list-item-right-border">
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: "peopleList",
  20. props: {
  21. list: {
  22. type: Array,
  23. default: () => []
  24. }
  25. },
  26. data() {
  27. return {
  28. };
  29. },
  30. methods:{
  31. itemClick(item) {
  32. console.log(item);
  33. item.show = !item.show
  34. this.$emit('updata:list',this.list)
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .people-list {
  41. width: 100%;
  42. }
  43. .people-list-item {
  44. padding: 32rpx;
  45. border-bottom: 1px solid #f2f2f2;
  46. box-sizing: border-box;
  47. display: flex;
  48. justify-content: space-between;
  49. }
  50. .people-list-item-right {}
  51. .people-list-item-right-border {
  52. width: 40rpx;
  53. height: 40rpx;
  54. border-radius: 50%;
  55. border: 2px solid rgba(136, 230, 210, 1);
  56. box-sizing: border-box;
  57. }
  58. .people-list-item-right-active {
  59. width: 40rpx;
  60. height: 40rpx;
  61. border-radius: 50%;
  62. background-color: rgba(5, 204, 161, 1);
  63. text-align: center;
  64. line-height: 40rpx;
  65. }
  66. </style>