index.vue 951 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <script setup lang="tsx">
  2. import type { InternalRowData } from 'naive-ui/es/data-table/src/interface';
  3. import { fetchGetTagList } from '@/service/api/goods/tag';
  4. import { useTable } from '@/components/zt/Table/hooks/useTable';
  5. const columns: NaiveUI.TableColumn<InternalRowData>[] = [
  6. {
  7. key: 'name',
  8. title: '标签名称',
  9. align: 'center',
  10. minWidth: 100
  11. }
  12. ];
  13. const [registerTable] = useTable({
  14. searchFormConfig: {
  15. schemas: [
  16. {
  17. field: 'name',
  18. label: '用户昵称',
  19. component: 'NInput'
  20. }
  21. ],
  22. inline: false,
  23. size: 'small',
  24. labelPlacement: 'left',
  25. isFull: false
  26. },
  27. tableConfig: {
  28. keyField: 'id',
  29. title: '标签列表',
  30. showAddButton: true
  31. }
  32. });
  33. </script>
  34. <template>
  35. <LayoutTable>
  36. <ZTable :columns="columns" :api="fetchGetTagList" :show-table-action="false" @register="registerTable"></ZTable>
  37. </LayoutTable>
  38. </template>
  39. <style scoped></style>