You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

BasicTableInfo.stories.tsx 2.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import BasicTableInfo from '@/components/BasicTableInfo';
  2. import type { Meta, StoryObj } from '@storybook/react';
  3. import * as BasicInfoStories from './BasicInfo.stories';
  4. // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
  5. const meta = {
  6. title: 'Components/BasicTableInfo 基本信息表格版',
  7. component: BasicTableInfo,
  8. parameters: {
  9. // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
  10. // layout: 'centered',
  11. },
  12. // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
  13. tags: ['autodocs'],
  14. // More on argTypes: https://storybook.js.org/docs/api/argtypes
  15. argTypes: {
  16. datas: {
  17. description: '基础信息',
  18. table: {
  19. type: { summary: 'BasicInfoData[]' },
  20. },
  21. type: {
  22. required: true,
  23. name: 'array',
  24. value: {
  25. name: 'object',
  26. value: {},
  27. },
  28. },
  29. },
  30. labelWidth: {
  31. description: '标题宽度',
  32. type: {
  33. required: true,
  34. name: 'number',
  35. },
  36. },
  37. labelEllipsis: {
  38. description: '标题是否显示省略号',
  39. table: {
  40. type: { summary: 'boolean' },
  41. defaultValue: { summary: 'true' },
  42. },
  43. control: 'boolean',
  44. },
  45. className: {
  46. description: '自定义类名',
  47. table: {
  48. type: { summary: 'string' },
  49. },
  50. control: 'text',
  51. },
  52. style: {
  53. description: '自定义样式',
  54. table: {
  55. type: { summary: 'ReactCSSProperties' },
  56. },
  57. control: 'object',
  58. },
  59. },
  60. // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
  61. // args: { onClick: fn() },
  62. } satisfies Meta<typeof BasicTableInfo>;
  63. export default meta;
  64. type Story = StoryObj<typeof meta>;
  65. // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
  66. export const Primary: Story = {
  67. args: {
  68. datas: BasicInfoStories.Primary.args.datas,
  69. labelWidth: 100,
  70. labelEllipsis: true,
  71. },
  72. };