add custom part to v-autocomplete dropdown
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm using vuetify's v-autocomplete component, and I'd like to add custom part to its dropdown (marked with red arrow on this screenshot: https://prnt.sc/lm3vjc)
This is how my component looks like, so I'd like to add that part on top of items:
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
javascript html5 vue.js autocomplete vuetify.js
add a comment |
I'm using vuetify's v-autocomplete component, and I'd like to add custom part to its dropdown (marked with red arrow on this screenshot: https://prnt.sc/lm3vjc)
This is how my component looks like, so I'd like to add that part on top of items:
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
javascript html5 vue.js autocomplete vuetify.js
add a comment |
I'm using vuetify's v-autocomplete component, and I'd like to add custom part to its dropdown (marked with red arrow on this screenshot: https://prnt.sc/lm3vjc)
This is how my component looks like, so I'd like to add that part on top of items:
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
javascript html5 vue.js autocomplete vuetify.js
I'm using vuetify's v-autocomplete component, and I'd like to add custom part to its dropdown (marked with red arrow on this screenshot: https://prnt.sc/lm3vjc)
This is how my component looks like, so I'd like to add that part on top of items:
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
javascript html5 vue.js autocomplete vuetify.js
javascript html5 vue.js autocomplete vuetify.js
asked Nov 23 '18 at 16:17
kecmankecman
195115
195115
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can use prepend-item
slot. It will add, before the first item, whatever you want.
With your exemple, it should looks like this :
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<v-list-tile
slot="prepend-item"
class="grey--text">
{{ items.length }} candidates found
</v-list-tile>
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
Prepend and Append slot in Vuetify Documentation
Edit for V1.1.0+ : Those slots are available in v-autocomplete
and v-combobox
as they inherit from v-select
.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53449980%2fadd-custom-part-to-v-autocomplete-dropdown%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use prepend-item
slot. It will add, before the first item, whatever you want.
With your exemple, it should looks like this :
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<v-list-tile
slot="prepend-item"
class="grey--text">
{{ items.length }} candidates found
</v-list-tile>
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
Prepend and Append slot in Vuetify Documentation
Edit for V1.1.0+ : Those slots are available in v-autocomplete
and v-combobox
as they inherit from v-select
.
add a comment |
You can use prepend-item
slot. It will add, before the first item, whatever you want.
With your exemple, it should looks like this :
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<v-list-tile
slot="prepend-item"
class="grey--text">
{{ items.length }} candidates found
</v-list-tile>
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
Prepend and Append slot in Vuetify Documentation
Edit for V1.1.0+ : Those slots are available in v-autocomplete
and v-combobox
as they inherit from v-select
.
add a comment |
You can use prepend-item
slot. It will add, before the first item, whatever you want.
With your exemple, it should looks like this :
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<v-list-tile
slot="prepend-item"
class="grey--text">
{{ items.length }} candidates found
</v-list-tile>
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
Prepend and Append slot in Vuetify Documentation
Edit for V1.1.0+ : Those slots are available in v-autocomplete
and v-combobox
as they inherit from v-select
.
You can use prepend-item
slot. It will add, before the first item, whatever you want.
With your exemple, it should looks like this :
<v-autocomplete @change='selectedSearchedCandidate' append-icon="search" :loading="loading" :filter="v => v" :items="items" :search-input.sync="search" v-model="select" flat hide-no-data hide-details return-object placeholder="Search candidates">
<v-list-tile
slot="prepend-item"
class="grey--text">
{{ items.length }} candidates found
</v-list-tile>
<template slot="selection" slot-scope="{ item, selected }">
{{item.firstName}} {{item.lastName}}
</template>
<template slot="item" slot-scope="{ item, tile }">
<v-list-tile-content>
<p class='fullName'>{{item.firstName}} {{item.lastName}}</p>
<p class='employer'>{{item.employer}}</p>
<p class='phoneNumber grey--text'>{{formattedPhoneNumber(item.phoneNumber)}}</p>
</v-list-tile-content>
</template>
</v-autocomplete>
Prepend and Append slot in Vuetify Documentation
Edit for V1.1.0+ : Those slots are available in v-autocomplete
and v-combobox
as they inherit from v-select
.
edited Apr 2 at 7:49
answered Nov 23 '18 at 19:03
ToodooToodoo
2,22811234
2,22811234
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53449980%2fadd-custom-part-to-v-autocomplete-dropdown%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown