this is my Table component.
<b-table
class="table table-striped"
id="my-table"
:items="items"
:per-page="perPage"
:current-page="currentPage"
:fields="fields"
@row-clicked="test"
lg
></b-table>
method on the same component:
methods: {
test(){
console.log('test')
this.$emit('rowClick',"heyoooooooo")
}
},
parent component:
<ClientTable :fields="fields" :items="rows" :sortBy="sortBy" :sortDesc="sortDesc" @rowClicked="Callme()"/>
parent method:
methods: {
Callme(e){
console.log('hee')
}
},
I'm really new with VueJS and I stumbled with Emit I was wondering why is my code not working, does not console anything.
thanks
rowClickbut your parent component subscribes to@rowClicked.this.$emit('rowClicked',"heyoooooooo")also added () on test(). Are you using bootstrap vueb-table? Try@row-clickedon your parent component (kebab-case event names)