1
1
<script lang="ts">
2
2
import type { PrimitiveProps } from ' @/Primitive'
3
3
import { useVModel } from ' @vueuse/core'
4
- import { clamp , createContext , snapValueToStep , useFormControl } from ' @/shared'
4
+ import { clamp , createContext , snapValueToStep , useFormControl , useLocale } from ' @/shared'
5
5
import { type HTMLAttributes , type Ref , computed , ref , toRefs } from ' vue'
6
6
7
7
export interface NumberFieldRootProps extends PrimitiveProps {
@@ -64,11 +64,10 @@ defineOptions({
64
64
const props = withDefaults (defineProps <NumberFieldRootProps >(), {
65
65
as: ' div' ,
66
66
defaultValue: undefined ,
67
- locale: ' en-US' ,
68
67
step: 1 ,
69
68
})
70
69
const emits = defineEmits <NumberFieldRootEmits >()
71
- const { disabled, min, max, step, locale, formatOptions, id } = toRefs (props )
70
+ const { disabled, min, max, step, formatOptions, id, locale : propLocale } = toRefs (props )
72
71
73
72
const modelValue = useVModel (props , ' modelValue' , emits , {
74
73
defaultValue: props .defaultValue ,
@@ -77,6 +76,7 @@ const modelValue = useVModel(props, 'modelValue', emits, {
77
76
78
77
const { primitiveElement, currentElement } = usePrimitiveElement ()
79
78
79
+ const locale = useLocale (propLocale )
80
80
const isFormControl = useFormControl (currentElement )
81
81
const inputEl = ref <HTMLInputElement >()
82
82
0 commit comments