2021-09-01 20:07:11 -05:00
|
|
|
<template>
|
2021-09-05 15:22:30 -05:00
|
|
|
<input v-model="input" ref="input" autofocus :type="type" :disabled="disabled" autocorrect="off" autocapitalize="none" autocomplete="off" :placeholder="placeholder" class="px-2 py-1 bg-bg border border-gray-600 outline-none rounded-sm" :class="disabled ? 'text-gray-300' : 'text-white'" @keyup="keyup" />
|
2021-09-01 20:07:11 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
value: [String, Number],
|
|
|
|
placeholder: String,
|
|
|
|
type: String,
|
|
|
|
disabled: Boolean
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
input: {
|
|
|
|
get() {
|
|
|
|
return this.value
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$emit('input', val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-09-05 15:22:30 -05:00
|
|
|
methods: {
|
|
|
|
focus() {
|
|
|
|
if (this.$refs.input) {
|
|
|
|
this.$refs.input.focus()
|
|
|
|
this.$refs.input.click()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
keyup() {
|
|
|
|
if (this.$refs.input) {
|
|
|
|
this.input = this.$refs.input.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-09-01 20:07:11 -05:00
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|