vue+elementui dropdown 下拉菜单绑定方法 您所在的位置:网站首页 elementui弹窗触底反弹方法 vue+elementui dropdown 下拉菜单绑定方法

vue+elementui dropdown 下拉菜单绑定方法

2024-05-08 17:29| 来源: 网络整理| 查看: 265

方法一:给el-dropdown根组件监听command ,再el-dropdown-item 绑定commandshuxing值。 methods内详细写监听对应的方法

handleCommand(command) { if(command == 'loginOut'){ this.$confirm('are you sure loginOut?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { this.$message({ type: 'success', message: 'loginOut成功!' }); }).catch(() => { this.$message({ type: 'info', message: '已取消loginOut' }); }); } // else if(command == 'resetPwd'){ // this.$alert( // ``, // 'notice', // { // dangerouslyUseHTMLString: true, // showClose:true, // callback: action => { // this.$message({ // type: 'info', // message: `action: ${ action }` // }) // }, // } // ) // } }, 缺点:如果在处理事件内需要弹出表单元素,则只能使用原生html,无法使用dialog。 方法二:给el-dropdown-item 绑定点击事件。但是无效果,需要用 @click.native=" name"  这样绑定才会有效。  resetPassword:function(){ this.dialogFormVisible = true console.log("重置密码") }  


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有