zoukankan      html  css  js  c++  java
  • vue-element的<el-tooltip>气泡提示失效问题

    问题:

    页面按钮太多, 弹框很多, 但是有些不必要的, UI也没说有限制,  我想用<el-tooltip>来根据不同状态来用气泡提示 ,

    使用时<el-tooltip>经常用来包含<el-button>, 但是遇到<el-button>为禁用disabled=true的时候, 会失效.

    解决办法:

    使用<span>来让这些<el-button>块成为内联元素( ele的UI弹性布局 ,<el-col :span="24"> 布局很难操作 )

    最终结果:

    代码:

    <el-tooltip content="【查看】请先选中一条数据进行操作!"
                      :disabled="activeList && activeList.length == 1 ? true : false"
                      placement="top">
            <span>
              <el-button :disabled="activeList && activeList.length==1 ? false : true"
                         @click="handleButtonType('see')">查看</el-button>
            </span>
    
          </el-tooltip>
          <el-tooltip :disabled="activeList && activeList.length==1 && activeList[0].status == 'noaudit' ? true : false"
                      placement="top">
            <div slot="content">【修改】、【删除】、【保存1】按钮<br />仅可对状态为保存1的数据进行操作!</div>
            <span class="mLeft10 mRight10">
              <el-button :disabled="activeList && activeList.length==1 && activeList[0].status == 'noaudit' ? false : true"
                         @click="handleButtonType('edit')">修改</el-button>
              <el-button :disabled="activeList && activeList.length==1 && activeList[0].status == 'noaudit' ? false : true"
                         @click="handleButtonType('del')">删除</el-button>
              <el-button :disabled="activeList && activeList.length==1 && activeList[0].status == 'noaudit' ? false : true"
                         @click="handleButtonType('audit')">嗯嗯嗯</el-button>
            </span>
    </el-tooltip>
    <el-tooltip content="【保存】仅可对状态为保存2的数据进行操作!"
                      :disabled="activeList && activeList.length==1 && activeList[0].status == 'audit' ? true : false"
                      placement="top">
            <span>
              <el-button type="primary"
                         :disabled="activeList && activeList.length==1 && activeList[0].status == 'audit' ? false : true"
                         @click="handleButtonType('noaudit')">保存2</el-button>
            </span>
    </el-tooltip>
  • 相关阅读:
    CSU 1605 数独
    HDU 1426 dancing links解决数独问题
    FZU 1686 dlx重复覆盖
    hdu 2295 dlx重复覆盖+二分答案
    zju 3209 dancing links 求取最小行数
    hust 1017 dancing links 精确覆盖模板题
    POJ 1724 二维费用最短路
    【转载】学习总结:初等数论(3)——原根、指标及其应用
    【poj3415-Common Substrings】sam子串计数
    【hdu4436/LA6387-str2int】sam处理不同子串
  • 原文地址:https://www.cnblogs.com/wangduojing/p/13714221.html
Copyright © 2011-2022 走看看