demo10.vue 814 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <m-table :data="tableData" @on-selection-change="selectionChange">
  3. <m-table-column type="selection" width="55" />
  4. <m-table-column prop="date" label="日期" />
  5. <m-table-column prop="name" label="姓名" />
  6. <m-table-column prop="address" label="地址" />
  7. </m-table>
  8. </template>
  9. <script setup>
  10. const tableData = [
  11. {
  12. id: 111,
  13. date: '2022-05-12',
  14. name: '后裔',
  15. address: '王者峡谷下塔旁'
  16. },
  17. {
  18. id: 222,
  19. date: '2022-06-13',
  20. name: '鲁班',
  21. address: '在逛街'
  22. },
  23. {
  24. id: 333,
  25. date: '2022-07-14',
  26. name: '孙尚香',
  27. address: '在打红buff'
  28. },
  29. {
  30. id: 444,
  31. date: '2022-08-15',
  32. name: '狄仁杰',
  33. address: '在推塔'
  34. }
  35. ]
  36. const selectionChange = (selection) => {
  37. console.log(selection);
  38. }
  39. </script>