Filled state support for floating inputs

pull/3/head
cagataycivici 2018-12-07 23:53:24 +03:00
parent 466484fb37
commit 0640144ca5
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
<template> <template>
<input class="p-inputtext p-component" v-on="listeners" :value="value" /> <input :class="{'p-inputtext p-component':true, 'p-filled': filled}"
v-on="listeners" :value="value" />
</template> </template>
<script> <script>
@ -13,6 +14,9 @@ export default {
...this.$listeners, ...this.$listeners,
input: event => this.$emit('input', event.target.value) input: event => this.$emit('input', event.target.value)
}; };
},
filled() {
return (this.value != null && this.value.toString().length > 0)
} }
} }
} }