import type { Meta, StoryObj } from '@storybook/vue3'; import { ref } from 'vue'; import { FileInput, UploadedFile } from '~/components'; type Story = StoryObj; const meta: Meta = { title: 'Application/Upload/FileInput', component: FileInput, tags: ['file', 'file input', 'input', 'upload'], argTypes: { modelValue: { table: { disable: true } }, }, args: { limit: 3, disabled: false, label: 'Browse your computer', }, }; export const FileInput_: Story = { render: args => ({ components: { FileInput, UploadedFile }, setup() { const attachments = ref([]); const deleteFile = (file: File) => { const idx = attachments.value.indexOf(file); if (idx > -1) { attachments.value.splice(idx, 1); } }; return { args, attachments, deleteFile }; }, template: `
`, }), }; export default meta;