Skip to content

Commit de67b49

Browse files
committed
feat(input): control input position in storybook
1 parent a12bc62 commit de67b49

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

packages/input/tests/input.stories.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import TournantInput from '../src/index.vue'
2-
import { withKnobs, text } from '@storybook/addon-knobs'
2+
import { withKnobs, text, radios } from '@storybook/addon-knobs'
33

44
// const dataNoError = { $error: false, $dirty: false }
55

@@ -67,11 +67,35 @@ export const withError = () => ({
6767
</tournant-input>`
6868
})
6969

70+
const descriptionPositions = {
71+
Top: 'top',
72+
Bottom: 'bottom'
73+
}
74+
7075
export const withDescription = () => ({
7176
components: { TournantInput },
77+
props: {
78+
descriptionPosition: {
79+
default: radios(
80+
'Description position',
81+
descriptionPositions,
82+
'bottom',
83+
'tuidescpos'
84+
)
85+
}
86+
},
7287
data: () => ({
7388
validation: { $error: false, $dirty: false },
7489
password: ''
7590
}),
76-
template: `<tournant-input label="password" :validation="validation" value="" v-model="password" type="password" description="Your password must be unique to this site." />`
91+
template: `
92+
<tournant-input
93+
label="password"
94+
:validation="validation"
95+
value=""
96+
v-model="password"
97+
type="password"
98+
description="Your password must be unique to this site."
99+
:description-position="descriptionPosition" />
100+
`
77101
})

0 commit comments

Comments
 (0)