2018-12-07 11:02:58 +00:00
|
|
|
<template>
|
2022-07-05 12:23:51 +00:00
|
|
|
<input :class="['p-inputtext p-component', {'p-filled': filled}]" :value="modelValue" @input="onInput"/>
|
2018-12-07 11:02:58 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2021-05-11 09:11:49 +00:00
|
|
|
name: 'InputText',
|
2020-10-21 18:03:17 +00:00
|
|
|
emits: ['update:modelValue'],
|
2018-12-07 11:02:58 +00:00
|
|
|
props: {
|
2020-09-12 20:57:21 +00:00
|
|
|
modelValue: null
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onInput(event) {
|
|
|
|
this.$emit('update:modelValue', event.target.value);
|
|
|
|
}
|
2018-12-07 11:02:58 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2018-12-07 20:53:24 +00:00
|
|
|
filled() {
|
2020-09-12 20:57:21 +00:00
|
|
|
return (this.modelValue != null && this.modelValue.toString().length > 0)
|
2018-12-07 11:02:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-11 09:11:49 +00:00
|
|
|
</script>
|