Tooltip 文字提示,居中显示

Tooltip 文字提示有时候在table中无法居中显示,这个可以设置一下

<a-tooltip
             placement="top"
                  overlayClassName="label-management-tooltip"
                  class="ant_too"
                  :getPopupContainer="
                    (triggerNode) => {
                      return triggerNode.parentNode
                    }
                  "
          >
            <template>
              <div>
               {{name}}
              </div>
            </template>
            <span>
                {{name}}
            </span>
          </a-tooltip>
<style lang="less">
.label-management-tooltip.ant-tooltip {
  max-width: 300px !important;
  white-space: break-spaces;
}
</style>

<style lang="less" scoped>
.ant_too {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
</style>

 

posted @ 2022-11-17 17:29  Private!  阅读(533)  评论(0编辑  收藏  举报