I had 2 components - search filter, and iterator in the same component App.vue like that:
App.vue
<v-text-field
:search="search"
v-model="search"
label="type here to filter"
>
</v-text-field>
<v-data-iterator
:items="sortedContents"
:search="search"
v-model="selected"
>
...
</v-data-iterator>
...
data () {
return {
search: '',
{
}
But then I moved that search filter into a separate component called <toolbar> and it the search filter inside it doesn't work anymore:
App.vue
<!-- this component contains the <v-text-field> -->
<toolbar :search="search"></toolbar>
<v-data-iterator
:items="sortedContents"
:search="search"
v-model="selected"
>
...
</v-data-iterator>
...
data () {
return {
search: '',
{
}
Codepen: https://codepen.io/anon/pen/ddEjgp?editors=1010
Question:
What should I add into that new <toolbar> component in order for it to pass the data typed into that search filter to the App.vue parent component?
props: ['search'],but it still doesn't work, am I doing it wrong? - Un1