Hi everyone,
I want to add a dropdown menu in the toolbar where each option is represented by an object containing id, type, and title. Upon selection, I need to get both the id and type associated with that option. However, my current configuration does not work as expected.
Current Configuration
Here's how I've configured the dropdown:
{
type: 'select',
options: [
{
id: -1,
type: 1,
title: '默认视图', // This should be displayed in the dropdown
},
],
value: -1,
listener: function () {
console.error('select');
},
}
However, this setup results in an error or does not correctly display the title nor returns the id and type upon selection.
Could anyone please guide me on how to achieve this? Specifically, how can I ensure that the dropdown displays the title and allows me to retrieve both id and type upon selection?
Any advice or pointers would be greatly appreciated.
Thank you in advance for your help!
Best regards