<el-dropdown @command="handleCommand">
<el-button type="primary">
{{dropvalue}}<i class="el-icon-caret-bottom el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item,index) in dropDowns" command="item.index">{{item.name}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
If you want to get the index in the current loop, "1, 2, 3···" instead of the "item.index" string, the incoming command="item.index" will not work. The display effect is as follows
The command command here is the default if you are hungry. If you use an enumeration drop-down box, such as:
<el-dropdown-item command="a">Golden Cake</el-dropdown- item>At this time, the value can be obtained as a.