<script setup lang="ts">
import { ref,watch } from 'vue';

const props = defineProps<{
  modelValue: string | undefined
}>()

const emits = defineEmits(["update:modelValue"])

const value = ref<number | undefined>(props.modelValue === undefined ? undefined : parseFloat(props.modelValue))

const change = (val: number | undefined) => {
  value.value = val
  emits("update:modelValue", val?.toString())
}

</script>

<template>
  <slot :value="value" :change="change"></slot>
</template>
