Currency input expulsion

This commit is contained in:
AnandaTon 2023-08-22 09:00:36 +07:00
parent a3eabec197
commit 4c6f18176d
3 changed files with 16 additions and 65 deletions

View file

@ -1,47 +0,0 @@
<template>
<input
:class="
edit == true
? 'full-width inputgreen cursor-pointer'
: 'full-width cursor-pointer'
"
:outlined="edit"
dense
ref="inputRef"
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="test"
:label="`${'เงินเดือน'}`"
hide-bottom-space
type="text"
@update:modelValue="updateCoords(test)"
/>
{{ salary }}
</template>
<script>
import { useCurrencyInput } from "vue-currency-input";
export default {
name: "CurrencyInput",
props: {
salary: String,
edit: Boolean,
modelValue: Number,
options: Object,
},
emits: ["update:salary"],
setup(props) {
const { inputRef } = useCurrencyInput(props.options);
const test = "";
return { inputRef };
},
methods: {
updateCoords(title) {
console.log("asd");
this.$emit("update:salary", title); // previously was `this.$emit('input', title)`
},
},
// watch(){}
};
</script>

View file

@ -198,7 +198,10 @@
<CurrencyInput
v-model="salary"
:edit="edit"
:options="{ currency: 'THB' }"
:options="{
currency: 'THB',
}"
:label="`${'เงินเดือน'}`"
/>
</div>
</div>
@ -288,7 +291,7 @@ import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/modules/06_retirement/components/CurrencyInput.vue";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";