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

27 lines
637 B
Vue
Raw Normal View History

2022-09-06 12:03:37 +00:00
<template>
2023-05-05 12:53:35 +00:00
<input :class="['p-inputtext p-component', { 'p-filled': filled }]" :value="modelValue" @input="onInput" v-bind="ptm('root')" />
2022-09-06 12:03:37 +00:00
</template>
<script>
2023-05-05 12:53:35 +00:00
import BaseComponent from 'primevue/basecomponent';
2022-09-06 12:03:37 +00:00
export default {
name: 'InputText',
2023-05-05 12:53:35 +00:00
extends: BaseComponent,
2022-09-06 12:03:37 +00:00
emits: ['update:modelValue'],
props: {
modelValue: null
},
methods: {
onInput(event) {
this.$emit('update:modelValue', event.target.value);
}
},
computed: {
filled() {
2022-09-14 11:26:01 +00:00
return this.modelValue != null && this.modelValue.toString().length > 0;
2022-09-06 12:03:37 +00:00
}
}
2022-09-14 11:26:01 +00:00
};
2022-09-06 12:03:37 +00:00
</script>