Currency input expulsion
This commit is contained in:
parent
a3eabec197
commit
4c6f18176d
3 changed files with 16 additions and 65 deletions
|
|
@ -3,10 +3,15 @@
|
|||
ref="inputRef"
|
||||
v-model="formattedValue"
|
||||
:dense="dense"
|
||||
:outlined="outlined"
|
||||
:class="className"
|
||||
:readonly="readonly"
|
||||
:borderless="borderless"
|
||||
:outlined="edit"
|
||||
:class="
|
||||
edit == true
|
||||
? 'full-width inputgreen cursor-pointer'
|
||||
: 'full-width cursor-pointer'
|
||||
"
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-for="(_, slot) in slots" v-slot:[slot]="scope">
|
||||
<slot :name="slot" v-bind="scope || {}" />
|
||||
|
|
@ -24,21 +29,11 @@ const props = defineProps({
|
|||
modelValue: Number,
|
||||
dense: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: true,
|
||||
},
|
||||
outlined: {
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
borderless: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
className: String,
|
||||
});
|
||||
|
||||
const { inputRef, formattedValue, setValue } = useCurrencyInput({
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue