fix(components): [table] adjust the showOverflowTooltip value logic (#13282)

* fix(components): [table] adjust the showOverflowTooltip value logic

* fix: set showOverflowTooltip default value to undefined
This commit is contained in:
btea 2023-06-20 16:04:26 +08:00 committed by GitHub
parent 1ff22aa97a
commit 74c2448ce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -113,9 +113,12 @@ export default {
columnKey: String,
align: String,
headerAlign: String,
showOverflowTooltip: [Boolean, Object] as PropType<
TableColumnCtx<DefaultRow>['showOverflowTooltip']
>,
showOverflowTooltip: {
type: [Boolean, Object] as PropType<
TableColumnCtx<DefaultRow>['showOverflowTooltip']
>,
default: undefined,
},
fixed: [Boolean, String],
formatter: Function as PropType<TableColumnCtx<DefaultRow>['formatter']>,
selectable: Function as PropType<TableColumnCtx<DefaultRow>['selectable']>,

View File

@ -11,7 +11,7 @@ import {
ref,
} from 'vue'
import ElCheckbox from '@element-plus/components/checkbox'
import { isString } from '@element-plus/utils'
import { isString, isUndefined } from '@element-plus/utils'
import { cellStarts } from '../config'
import { compose, mergeOptions } from '../util'
import useWatcher from './watcher-helper'
@ -67,8 +67,9 @@ export default defineComponent({
const type = props.type || 'default'
const sortable = props.sortable === '' ? true : props.sortable
const showOverflowTooltip =
props.showOverflowTooltip || parent.props.showOverflowTooltip
const showOverflowTooltip = isUndefined(props.showOverflowTooltip)
? parent.props.showOverflowTooltip
: props.showOverflowTooltip
const defaults = {
...cellStarts[type],
id: columnId.value,