-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
28 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
packages/ui/src/components/va-aspect-ratio/VaAspectRatio.demo.vue
This file was deleted.
Oops, something went wrong.
79 changes: 75 additions & 4 deletions
79
packages/ui/src/components/va-aspect-ratio/VaAspectRatio.stories.ts
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 |
---|---|---|
@@ -1,12 +1,83 @@ | ||
import { defineComponent } from 'vue' | ||
import VaAspectRatio from './VaAspectRatio.demo.vue' | ||
import { VaAspectRatio } from './' | ||
|
||
export default { | ||
title: 'VaAspectRatio', | ||
component: VaAspectRatio, | ||
tags: ['autodocs'], | ||
} | ||
|
||
export const Default = defineComponent({ | ||
export const Default = () => ({ | ||
components: { VaAspectRatio }, | ||
template: '<VaAspectRatio/>', | ||
template: ` | ||
<va-aspect-ratio | ||
:style="{ width: '200px', border: '1px solid black' }" | ||
:ratio="1/1" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
`, | ||
}) | ||
|
||
export const Ratio = () => ({ | ||
components: { VaAspectRatio }, | ||
template: ` | ||
[1/1] | ||
<va-aspect-ratio | ||
:style="{ width: '200px', border: '1px solid black' }" | ||
:ratio="1/1" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
[16/9] | ||
<va-aspect-ratio | ||
:style="{ width: '200px', border: '1px solid black' }" | ||
:ratio="16/9" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
`, | ||
}) | ||
|
||
export const contentHeightAndWidth = () => ({ | ||
components: { VaAspectRatio }, | ||
template: ` | ||
[200/200] | ||
<va-aspect-ratio | ||
:style="{ width: '200px', border: '1px solid black' }" | ||
:content-width="200" | ||
:content-height="200" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
[1280/720] | ||
<va-aspect-ratio | ||
:style="{ width: '200px', border: '1px solid black' }" | ||
:content-width="1280" | ||
:content-height="720" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
`, | ||
}) | ||
|
||
export const maxWidth = () => ({ | ||
components: { VaAspectRatio }, | ||
template: ` | ||
[200] | ||
<va-aspect-ratio | ||
:style="{ width: '500px', border: '1px solid black' }" | ||
:max-width="200" | ||
:ratio="16/9" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
[500] | ||
<va-aspect-ratio | ||
:style="{ width: '500px', border: '1px solid black' }" | ||
:max-width="500" | ||
:ratio="16/9" | ||
> | ||
Content | ||
</va-aspect-ratio> | ||
`, | ||
}) |