Skip to content

Commit 3243fb8

Browse files
fix(Input/Textarea): define model modifiers types (#4195)
Co-authored-by: Benjamin Canac <[email protected]>
1 parent 43d281f commit 3243fb8

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/runtime/components/Input.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ export interface InputProps extends UseComponentIconsProps {
3838
disabled?: boolean
3939
/** Highlight the ring color like a focus state. */
4040
highlight?: boolean
41+
modelModifiers?: {
42+
string?: boolean
43+
number?: boolean
44+
trim?: boolean
45+
lazy?: boolean
46+
nullify?: boolean
47+
}
4148
class?: any
4249
ui?: Input['slots']
4350
}
@@ -77,6 +84,7 @@ const props = withDefaults(defineProps<InputProps>(), {
7784
const emits = defineEmits<InputEmits<T>>()
7885
const slots = defineSlots<InputSlots>()
7986
87+
// eslint-disable-next-line vue/no-dupe-keys
8088
const [modelValue, modelModifiers] = defineModel<T>()
8189
8290
const appConfig = useAppConfig() as Input['AppConfig']

src/runtime/components/Textarea.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ export interface TextareaProps extends UseComponentIconsProps {
3535
autoresize?: boolean
3636
autoresizeDelay?: number
3737
disabled?: boolean
38-
class?: any
3938
rows?: number
4039
maxrows?: number
4140
/** Highlight the ring color like a focus state. */
4241
highlight?: boolean
42+
modelModifiers?: {
43+
string?: boolean
44+
trim?: boolean
45+
lazy?: boolean
46+
nullify?: boolean
47+
}
48+
class?: any
4349
ui?: Textarea['slots']
4450
}
4551
@@ -76,6 +82,7 @@ const props = withDefaults(defineProps<TextareaProps>(), {
7682
const emits = defineEmits<TextareaEmits<T>>()
7783
const slots = defineSlots<TextareaSlots>()
7884
85+
// eslint-disable-next-line vue/no-dupe-keys
7986
const [modelValue, modelModifiers] = defineModel<T>()
8087
8188
const appConfig = useAppConfig() as Textarea['AppConfig']

0 commit comments

Comments
 (0)