zoukankan      html  css  js  c++  java
  • vue+elementui dropdown 下拉菜单绑定方法

    方法一:给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(
    // `<input
    // placeholder="输入名字搜索"/>`,
    // '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("重置密码")
    }
     
  • 相关阅读:
    mysql创建用户后无法访问数据库的问题
    mysql索引
    hadoop安装
    MySQL工作原理
    MySQL数据库优化的八种方式
    FLOAT 和 DOUBLE区别
    在C++中定义常量
    C++变量类型
    FTP主动模式、被动模式(转)
    FtpClient ReplyCode 意义及 FtpClientHelper辅助类
  • 原文地址:https://www.cnblogs.com/tutao1995/p/10394527.html
Copyright © 2011-2022 走看看