opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.71k stars 267 forks source link

🐛 [Bug]: Tooltip text prompt + Table component, prompt block display position offset, obscured #144

Closed Felix-jk closed 1 year ago

Felix-jk commented 1 year ago

Version

3.6.1

Vue Version

3.2.47

Link to minimal reproduction

如下

Step to reproduce

<template>
  <tiny-grid :data="tableData">
    <tiny-grid-column type="index" width="120"></tiny-grid-column>
    <tiny-grid-column field="name" title="名称" width="200"></tiny-grid-column>
    <tiny-grid-column field="area" title="所属区域" width="200"></tiny-grid-column>
    <tiny-grid-column field="address" title="地址" width="200"></tiny-grid-column>
    <tiny-grid-column field="introduction" title="公司简介" width="200" show-overflow></tiny-grid-column>

    <tiny-grid-column title="操作">
      <template v-slot="data">
        <tiny-tooltip class="item" effect="dark" content="编辑" placement="bottom" :append-to-body="false">
          <tiny-icon-search class="tiny-svg-size"></tiny-icon-search>
        </tiny-tooltip>
      </template>
    </tiny-grid-column>
  </tiny-grid>
</template>

<script>
import { Grid, GridColumn, Tooltip } from '@opentiny/vue'
import { IconSearch } from '@opentiny/vue-icon'

export default {
  components: {
    TinyGrid: Grid,
    TinyGridColumn: GridColumn,
    TinyTooltip: Tooltip,
    TinyIconSearch: IconSearch()
  },
  data() {
    return {
      tableData: [
        {
          id: 1,
          name: 'GFD科技YX公司',
          area: '华东区',
          address: '福州',
          introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
        },
        {
          id: 2,
          name: 'GFD科技YX公司',
          area: '华东区',
          address: '福州',
          introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
        },
        {
          id: 3,
          name: 'GFD科技YX公司',
          area: '华东区',
          address: '福州',
          introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
        }
      ]
    }
  }
}
</script>

What is expected

问题1: 显示位置偏移问题:鼠标指向操作图标后,期望是在图标的底部(tooltip 的placement 设置为bottom)显示文本提示;

问题2: 提示块被遮挡问题:鼠标指向最后一行数据 的操作图标,文本提示被遮挡,同时表格内部高度被撑开。鼠标往下滚动时,文本提示隐藏,表格内部高度还原。

What is actually happening

问题1: image

问题2: image

Any additional comments (optional)

No response

Felix-jk commented 1 year ago

表格出现横向滚动条时,Tooltip 还是会出现问题(定位异常、文本换行异常)

4dfbc346700a0ae5e8bf5daea1294c3 1d811624f768d794be8f51f3b1d5b3f