el-button type=success plain click=openDialogi-ep-plus 添加el-button这个按钮鼠标悬浮按钮上会显示下拉菜单 可以有两种选择一个是添加分类另一个是添加阻止机构。鼠标单击后弹出表单。
<p><el-dropdown @command="handleCommand">
<el-button type="success" plain>
<i-ep-plus />添加
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="addCategory">添加分类</el-dropdown-item>
<el-dropdown-item command="addInstitution">添加阻止机构</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown></p>
<script>
export default {
methods: {
handleCommand(command) {
if (command === "addCategory") {
// 执行添加分类操作
} else if (command === "addInstitution") {
// 执行添加阻止机构操作
}
}
}
}
</script
原文地址: https://www.cveoy.top/t/topic/iwuw 著作权归作者所有。请勿转载和采集!