<el-dropdown trigger="click" @command="handleCommand" placement="bottom" ></el-dropdown>
(command 自定义指令 用于下拉菜单里面内容点击事件
给需要加事件回调的加
<el-dropdown-item command="qhqy" ></el-dropdown-item>
methods: {
handleCommand(command){
if(command==='qhqy'){
执行函数
}
},
placement 菜单弹出位置 String 类型)
css里面添加
<style lang="scss" scoped>
::v-deep .el-dropdown-menu {
position: absolute!important;
min-width: 222px;
left: auto!important;
right: 0;
.popper__arrow{
left: 50%!important;
}
}
</style >