index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="list" v-for="(item,index) in list" :key="index">
  6. <view class="other">
  7. <view class="other_1">
  8. <text>磁盘名称:</text>
  9. <text>{{item.mounted}}</text>
  10. </view>
  11. <view class="other_1">
  12. <text>磁盘所占空间:</text>
  13. <text>{{item.capacity}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </mobile-frame>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. list: []
  26. };
  27. },
  28. onShow: function() {
  29. const that = this;
  30. that.searc();
  31. },
  32. methods: {
  33. async searc() {
  34. const that = this;
  35. let res = await that.$api(`/dir`, 'GET');
  36. if (res.errcode == '0') {
  37. console.log(res);
  38. // that.$set(that, `list`, res.data)
  39. }
  40. },
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .main {
  46. padding: 2vw 0;
  47. .one {
  48. padding: 0 2vw;
  49. margin: 0 0 2vw 0;
  50. .list {
  51. border: 1px solid var(--ff0Color);
  52. padding: 2vw;
  53. margin: 0 0 2vw 0;
  54. border-radius: 5px;
  55. .other {
  56. margin: 0 0 2vw 0;
  57. .other_1 {
  58. margin: 0 0 1vw 0;
  59. font-size: var(--font16Size);
  60. color: var(--f85Color);
  61. text:last-child {
  62. color: var(--f00Color);
  63. font-weight: bold;
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70. </style>