primevue-mirror/src/components/inputtext/InputText.vue

24 lines
532 B
Vue
Raw Normal View History

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 {
name: 'InputText',
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: {
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
}
}
}
</script>