-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(v-file-upload): added new file upload component
- Loading branch information
Showing
2 changed files
with
425 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import MyFileUpload from './VFileUpload.vue'; | ||
|
||
export default { | ||
title: 'Components/Form/FileUpload', | ||
component: MyFileUpload, | ||
argTypes: {}, | ||
args: { | ||
button: false, | ||
full: false, | ||
rounded: false, | ||
image: false, | ||
value: null, | ||
modelValue: null, | ||
accept: '', | ||
inputProps: {}, | ||
name: '', | ||
error: false, | ||
errorMessages: [], | ||
placeholder: 'Browse file...', | ||
id: '', | ||
}, | ||
}; | ||
|
||
const Template = (args) => ({ | ||
// Components used in your story `template` are defined in the `components` object | ||
components: { | ||
'my-component': MyFileUpload, | ||
}, | ||
// The story's `args` need to be mapped into the template through the `setup()` method | ||
setup() { | ||
return {args}; | ||
}, | ||
// And then the `args` are bound to your component with `v-bind="args"` | ||
template: `<my-component v-bind="args" />`, | ||
}); | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = {}; | ||
|
||
export const Button = Template.bind({}); | ||
Button.args = { | ||
button: true, | ||
}; | ||
|
||
export const Full = Template.bind({}); | ||
Full.args = { | ||
full: true, | ||
}; | ||
|
||
export const Rounded = Template.bind({}); | ||
Rounded.args = { | ||
rounded: true, | ||
}; | ||
|
||
export const Image = Template.bind({}); | ||
Image.args = { | ||
image: true, | ||
}; |
Oops, something went wrong.