add id & placeholder props to AutoCompleteInput component

This commit is contained in:
Xiaofeng An 2019-02-08 11:02:28 -05:00
parent 128dcc637e
commit 17c70fc0ef
3 changed files with 7 additions and 1 deletions

View file

@ -3,9 +3,12 @@ import { take, filter, map } from 'lodash'
const AutoCompleteInput = { const AutoCompleteInput = {
props: [ props: [
'id',
'classObj', 'classObj',
'value', 'value',
'placeholder',
'autoResize', 'autoResize',
'multiline',
'drop', 'drop',
'dragoverPrevent', 'dragoverPrevent',
'paste', 'paste',

View file

@ -4,9 +4,10 @@
v-if="multiline" v-if="multiline"
ref="textarea" ref="textarea"
:value="text" :value="text"
:id="id"
@input="text = $event.target.value, $emit('input', $event.target.value), autoResize && resize($event)" @input="text = $event.target.value, $emit('input', $event.target.value), autoResize && resize($event)"
@click="setCaret" @click="setCaret"
@keyup="setCaret" :placeholder="$t('post_status.default')" rows="1" :class="classObj" @keyup="setCaret" :placeholder="placeholder" rows="1" :class="classObj"
@keydown.down="cycleForward" @keydown.down="cycleForward"
@keydown.up="cycleBackward" @keydown.up="cycleBackward"
@keydown.shift.tab="cycleBackward" @keydown.shift.tab="cycleBackward"

View file

@ -18,7 +18,9 @@
class="form-cw"> class="form-cw">
<auto-complete-input v-model="newStatus.status" <auto-complete-input v-model="newStatus.status"
:classObj="{ 'form-control': true }" :classObj="{ 'form-control': true }"
:placeholder="$t('post_status.default')"
:autoResize="true" :autoResize="true"
:multiline="true"
:drop="fileDrop" :drop="fileDrop"
:dragoverPrevent="fileDrag" :dragoverPrevent="fileDrag"
:paste="paste" :paste="paste"