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
type: Function
},
placeholder: {
type: String,
default: 'Search...'
}
},
components: {

View File

@ -1,6 +1,6 @@
<template>
<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">
<BlockCard v-for="userId in filtered" :key="userId" :userId="userId"/>
</div>

View File

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