TerryZ / v-selectmenu

SelectMenu for Vuejs, A simple, easier and highly customized menu solution
https://terryz.github.io/docs-vue/#/selectmenu
MIT License
187 stars 25 forks source link

Getting the specific row selected #5

Closed web-surfer closed 6 years ago

web-surfer commented 6 years ago

How can I get information about a specific row/menu item a user has selected? I've tried the following:

<v-selectmenu :data="menu" :regular="true" @values="selected">
     <button>Select</button>
 </v-selectmenu>`

methods: {
     this.selected(a) {
            console.log(a);
      }
 }

But that doesn't seem to work. I've also tried in the data property itself:

{
    content: 'Dashboard',
    callback : this.selected('dashboard')
  }

But I can't get the callback to pass the argument to the method (the callback stops working all together when you try to pass in an argument).

I just want to be able to figure out what row/menu item a user selected. How can I do that?

TerryZ commented 6 years ago

The regular menu mode can not be selected, may be you can try advance mode

web-surfer commented 6 years ago

Okay, I switched to advanced mode and use the event 'values' to get an array when a user selects a menu item.