This commit is contained in:
Warunee Tamkoo 2023-08-18 14:29:09 +07:00
parent 0f6f04853c
commit cf75412206

View file

@ -2,20 +2,19 @@
<input ref="inputRef" type="text" />
</template>
<script setup lang="ts">
import { ref, watch } from "vue";
<script>
import { useCurrencyInput } from "vue-currency-input";
const props = defineProps({
modelValue: Number, // Vue 2: value
options: Object,
});
export default {
name: "CurrencyInput",
props: {
modelValue: Number,
options: Object,
},
setup(props) {
const { inputRef } = useCurrencyInput(props.options);
const inputRef = ref<any>();
watch(props, (count, prevCount) => {
console.log(" 1222", props);
if (props.options != null) inputRef.value = useCurrencyInput(props.options);
});
</script>
return { inputRef };
},
};
</script>