zoukankan      html  css  js  c++  java
  • Vue element Table 表头提示文案展示

    效果图:

    一:新建一个提示组件tableHeaderTip

    <template>
      <div class="tooltip">
        <el-tooltip effect="dark" placement="right">
          <div slot="content">
            <!-- msg数组传参,多行展示 -->
            <p v-for="(item, index) in messages" :key="index">{{item}}</p>
          </div>
          <!-- 可以做成自定义图标或者文案 -->
          <i class="el-icon-info" style="color: #409eff;margin-left:5px;"></i>
        </el-tooltip>
      </div>
    </template>
    
    <script>
    export default {
      name: 'tableHeaderTip',
      props: {
        messages: {
          type: Array,
          default: []
        }
      },
      data() {
        return {}
      }
    }
    </script>
    
    <style lang="scss" scope>
      .tooltip{display: inline-block;vertical-align: middle;}
    </style>

    二、父组件引入tableHeaderTip组件

    // template
    <el-table-column prop="sort_order" :render-header="renderHeader" align="center" label="排序" width="100"> // script import tableHeaderTip from '@/components/tableHeaderTip' export default { ... conponents: { tableHeaderTip }, ... methods: { renderHeader(h, { column }) { return h( // 创建元素 'div', [ h('span', column.label), // label标题文案 h(tableHeaderTip, { // tooltips组件 props: { messages: ['提示:','双击单元格可以修改排序数!'] } }) ] ) }, } }
  • 相关阅读:
    YXY-压测
    禅道使用
    抓https包
    数据库基本查询语句
    限制网速 制造测试条件
    测试中认识 sqlite
    Adb 命令
    jmeter 查看提取的参数
    jmeter传入字符时文本显示乱码
    nginx 访问springboot项目
  • 原文地址:https://www.cnblogs.com/cp-cookie/p/14759881.html
Copyright © 2011-2022 走看看