Files
mixtape/zero.Web.UI/App/editor/fields/number.vue
T

29 lines
581 B
Vue
Raw Normal View History

2020-05-26 16:04:11 +02:00
<template>
2020-10-20 13:27:17 +02:00
<input :value="value" @input="onChange($event.target.value)" type="text" class="ui-input" v-localize:placeholder="placeholder" :maxlength="maxLength" :disabled="disabled" />
2020-05-26 16:04:11 +02:00
</template>
<script>
export default {
props: {
2020-10-20 13:27:17 +02:00
value: Number,
maxLength: Number,
placeholder: String,
disabled: Boolean
2020-05-26 16:04:11 +02:00
},
methods: {
onChange(value)
{
var parsedValue = parseFloat(value);
if (isNaN(parsedValue))
{
return;
}
this.$emit('input', parsedValue);
}
}
}
</script>