make more generic

This commit is contained in:
taehoon 2019-04-02 15:43:41 -04:00
parent 8410add394
commit fc5f4fba8c
3 changed files with 6 additions and 2 deletions

View file

@ -10,6 +10,10 @@ export default {
}, },
filter: { // function to filter results in real time filter: { // function to filter results in real time
type: Function type: Function
},
placeholder: {
type: String,
default: 'Search...'
} }
}, },
components: { components: {

View file

@ -1,6 +1,6 @@
<template> <template>
<div class="user-autosuggest" v-click-outside="onClickOutside"> <div class="user-autosuggest" v-click-outside="onClickOutside">
<input v-model="term" placeholder="Search whom you want to block" @click="onInputClick" class="user-autosuggest-input" /> <input v-model="term" :placeholder="placeholder" @click="onInputClick" class="user-autosuggest-input" />
<div class="user-autosuggest-results" v-if="resultsVisible && filtered.length > 0"> <div class="user-autosuggest-results" v-if="resultsVisible && filtered.length > 0">
<BlockCard v-for="userId in filtered" :key="userId" :userId="userId"/> <BlockCard v-for="userId in filtered" :key="userId" :userId="userId"/>
</div> </div>

View file

@ -196,7 +196,7 @@
<div :label="$t('settings.blocks_tab')"> <div :label="$t('settings.blocks_tab')">
<div class="profile-edit-usersearch-wrapper"> <div class="profile-edit-usersearch-wrapper">
<UserAutoSuggest :filter="filterUnblockedUsers" :query="queryUserIds" /> <UserAutoSuggest :filter="filterUnblockedUsers" :query="queryUserIds" placeholder="Search whom you want to block" />
</div> </div>
<block-list :refresh="true"> <block-list :refresh="true">
<template slot="empty">{{$t('settings.no_blocks')}}</template> <template slot="empty">{{$t('settings.no_blocks')}}</template>