Files
mixtape/zero.Web.UI/App/editor/fields/number.vue
T
2020-10-20 13:27:17 +02:00

29 lines
581 B
Vue

<template>
<input :value="value" @input="onChange($event.target.value)" type="text" class="ui-input" v-localize:placeholder="placeholder" :maxlength="maxLength" :disabled="disabled" />
</template>
<script>
export default {
props: {
value: Number,
maxLength: Number,
placeholder: String,
disabled: Boolean
},
methods: {
onChange(value)
{
var parsedValue = parseFloat(value);
if (isNaN(parsedValue))
{
return;
}
this.$emit('input', parsedValue);
}
}
}
</script>