fix: 연산단위 최소값 지정
This commit is contained in:
@@ -102,6 +102,7 @@
|
||||
<NumberInputWithInfo
|
||||
v-model="nationPolicy.minimumResourceActionAmount"
|
||||
:step="100"
|
||||
:min="100"
|
||||
title="포상/몰수/헌납/삼/팜 최소 단위"
|
||||
>
|
||||
연산결과가 이 단위보다 적다면 수행하지 않습니다.
|
||||
@@ -111,6 +112,7 @@
|
||||
<NumberInputWithInfo
|
||||
v-model="nationPolicy.maximumResourceActionAmount"
|
||||
:step="100"
|
||||
:min="100"
|
||||
title="포상/몰수/헌납/삼/팜 최대 단위"
|
||||
>
|
||||
연산결과가 이 단위보다 크다면, 이 값에 맞춥니다.
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { clamp } from "lodash";
|
||||
import { defineComponent } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
@@ -98,11 +99,23 @@ export default defineComponent({
|
||||
this.rawValue = Math.floor(this.rawValue);
|
||||
}
|
||||
this.printValue = this.rawValue.toLocaleString();
|
||||
this.$emit("update:modelValue", this.rawValue);
|
||||
if (this.min !== undefined || this.max !== undefined) {
|
||||
const clampedValue = clamp(this.rawValue, this.min ?? this.rawValue, this.max ?? this.rawValue);
|
||||
this.$emit("update:modelValue", clampedValue);
|
||||
} else {
|
||||
this.$emit("update:modelValue", this.rawValue);
|
||||
}
|
||||
},
|
||||
onBlurNumber() {
|
||||
this.editmode = false;
|
||||
this.printValue = this.rawValue.toLocaleString();
|
||||
if (this.min !== undefined || this.max !== undefined) {
|
||||
const clampedValue = clamp(this.rawValue, this.min ?? this.rawValue, this.max ?? this.rawValue);
|
||||
if (clampedValue !== this.rawValue) {
|
||||
this.rawValue = clampedValue;
|
||||
this.updateValue();
|
||||
}
|
||||
}
|
||||
},
|
||||
onFocusText() {
|
||||
if (this.readonly) {
|
||||
|
||||
Reference in New Issue
Block a user