currency
This commit is contained in:
parent
0f6f04853c
commit
cf75412206
1 changed files with 13 additions and 14 deletions
|
|
@ -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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue