demo2.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <m-table
  3. :data="tableData"
  4. v-loading="loading"
  5. m-loading-text="拼命加载中..."
  6. m-loading-text-color="#fff"
  7. m-loading-icon-color="#fff"
  8. m-loading-background="rgba(0, 0, 0, .7)"
  9. >
  10. <m-table-column prop="date" label="日期" />
  11. <m-table-column prop="name" label="姓名" />
  12. <m-table-column prop="address" label="地址" />
  13. </m-table>
  14. <div class="mt-20">
  15. <m-switch v-model="loading"></m-switch>
  16. <span>开启/关闭Loading</span>
  17. </div>
  18. </template>
  19. <script setup>
  20. import { ref } from 'vue-demi';
  21. const loading = ref(true);
  22. const tableData = [
  23. {
  24. date: '2022-05-12',
  25. name: '后裔',
  26. address: '王者峡谷下塔旁'
  27. },
  28. {
  29. date: '2022-06-13',
  30. name: '鲁班',
  31. address: '在逛街'
  32. },
  33. {
  34. date: '2022-07-14',
  35. name: '孙尚香',
  36. address: '在打红buff'
  37. },
  38. {
  39. date: '2022-08-15',
  40. name: '狄仁杰',
  41. address: '在推塔'
  42. }
  43. ]
  44. </script>
  45. <style scoped>
  46. .mt-20{
  47. display: flex;
  48. margin-top: 20px;
  49. }
  50. .mt-20 span{
  51. margin-left: 10px;
  52. font-size: 14px;
  53. }
  54. </style>