Skip to content

Commit

Permalink
feat: Allow to customize Width for InputNumber Vue component- MEED-7379
Browse files Browse the repository at this point in the history
… - Meeds-io/MIPs#154 (#4098)

Allow to customize Width for InputNumber Vue component
  • Loading branch information
AzmiTouil committed Dec 1, 2024
1 parent 6d1ffac commit 6b56e03
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
:min="min"
:max="max"
:class="valid && 'text-color' || 'error-color'"
:style="inputStyle"
type="text"
class="layout-number-input pa-0 text-center">
class="pa-0 ma-0 text-center">
<div v-else>{{ num }}</div>
<div v-if="unit" class="ps-1">{{ unit }}</div>
<v-btn
Expand Down Expand Up @@ -86,12 +87,21 @@ export default {
type: Number,
default: () => 88,
},
inputWidth: {
type: Number,
default: () => 36,
},
},
data: () => ({
num: 20,
valid: false,
initialized: false,
}),
computed: {
inputStyle() {
return `width: ${this.inputWidth}px;`;
},
},
watch: {
num() {
if (!this.initialized) {
Expand Down

0 comments on commit 6b56e03

Please sign in to comment.