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, columnKey: String,
align: String, align: String,
headerAlign: String, headerAlign: String,
showOverflowTooltip: [Boolean, Object] as PropType< showOverflowTooltip: {
type: [Boolean, Object] as PropType<
TableColumnCtx<DefaultRow>['showOverflowTooltip'] TableColumnCtx<DefaultRow>['showOverflowTooltip']
>, >,
default: undefined,
},
fixed: [Boolean, String], fixed: [Boolean, String],
formatter: Function as PropType<TableColumnCtx<DefaultRow>['formatter']>, formatter: Function as PropType<TableColumnCtx<DefaultRow>['formatter']>,
selectable: Function as PropType<TableColumnCtx<DefaultRow>['selectable']>, selectable: Function as PropType<TableColumnCtx<DefaultRow>['selectable']>,

View File

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