index.vue 555 B

12345678910111213141516171819202122232425262728293031
  1. <script setup lang="ts">
  2. import { ref } from 'vue';
  3. import { NDataTable } from 'naive-ui';
  4. const columns = ref([
  5. {
  6. key: 'no',
  7. title: 'No',
  8. },
  9. {
  10. key: 'title',
  11. title: 'Title',
  12. },
  13. {
  14. key: 'length',
  15. title: 'Length',
  16. },
  17. ]);
  18. const data = [
  19. { length: '4:18', no: 3, title: 'Wonderwall' },
  20. { length: '4:48', no: 4, title: "Don't Look Back in Anger" },
  21. { length: '7:27', no: 12, title: 'Champagne Supernova' },
  22. ];
  23. </script>
  24. <template>
  25. <NDataTable :columns="columns" :data="data" />
  26. </template>
  27. <style scoped></style>