I have a component that is a table and I have a search button with the next event.
Component datatables:
<input type="text" class="form-control" @keyup="$emit('filterSearch')" v-model="search">
and in component B I import this component:
template>
<datatables @filter-search="filterSearch()">
</datatables>
</template>
<script>
import datatables from '../tables/datatables';
// import pagination from '../tables/pagination';
export default {
name: "userdraw",
components: {
datatables: datatables
},
methods: {
filterSearch(){
alert(1);
},
}
}
</script>
The question that when I write in the input search some letter / word I want a method to be executed in the parent component, but I never skip the filterSearch alert!