singleSelect.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="container">
  3. <view class="d-table">
  4. <view class="d-tr">
  5. <view class="d-th">第三方SDK</view>
  6. <view class="d-th">使用场景描述</view>
  7. <view class="d-th">共享的个人信息类型</view>
  8. </view>
  9. <!-- 为了提高dom渲染效率,当list产生破坏性变动时(如删除其中一项,或者排序等)必须使用唯一确定的key,而不能使用index -->
  10. <view class="d-tr" :class="{ active: currentRowIndex === i }" v-for="(item, i) in list" :key="item.id"
  11. @click="handleCurrentChange(item, i)">
  12. <view class="d-td">{{ item.name }}</view>
  13. <view class="d-td">{{ item.desc }}</view>
  14. <view class="d-td">{{ item.info }}</view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. name: 'singleSelect',
  22. data() {
  23. return {
  24. list: [{
  25. name: '友盟',
  26. desc: '用于数据统计及分析,微信分录、分享',
  27. info: '软件使用和点击记录、唯一设备识别码、设备MAC地址、IP地址',
  28. id: 1
  29. },
  30. {
  31. name: '高德地图',
  32. desc: '地理定位,获取位置信息',
  33. info: '个人位置信息',
  34. id: 2
  35. },
  36. {
  37. name: 'Bugly',
  38. desc: '用于崩溃日志收集',
  39. info: '崩溃日志、唯一设备识别码',
  40. id: 3
  41. }
  42. ],
  43. currentRowIndex: '',
  44. currentRow: ''
  45. };
  46. },
  47. methods: {
  48. handleCurrentChange(item, i) {
  49. this.currentRowIndex = i;
  50. this.currentRow = item;
  51. }
  52. }
  53. };
  54. </script>
  55. <style lang="scss">
  56. .container {
  57. margin: 24rpx 0;
  58. }
  59. .d-tr.active {
  60. // background-color: rgba($color: #ecf5ff, $alpha: 1);
  61. // color: #606266;
  62. }
  63. .d-tr {
  64. view {
  65. font-size: 24rpx;
  66. font-weight: bold;
  67. }
  68. .d-th:first-child,
  69. .d-td:first-child {
  70. width: 140rpx;
  71. }
  72. }
  73. </style>