Files

45 lines
890 B
Vue

<template>
<b-field
class="column mb-0 pb-0 mx-0 px-0"
:label="label"
:class="columnSize"
>
<b-input
icon="numeric"
type="number"
min="1"
max="99"
@keyup.enter.native="ejecutar()"
v-model="numero"
rounded
/>
</b-field>
</template>
<script>
export default {
props: {
ejecutar: { typeof: Function, required: true, default: () => {} },
numeroPadre: { typeof: Number, required: true, default: 1 },
columnSize: { typeof: String, required: false, default: '' },
label: { typeof: String, required: false, default: 'Número' },
},
data: () => {
return { numero: 1 }
},
watch: {
numero() {
this.$emit('numero', this.numero)
},
numeroPadre() {
this.numero = this.numeroPadre
},
},
created() {
this.numero = this.numeroPadre
},
}
</script>
<style scoped></style>