fix: inject value maybe undefined && tag style invalid (#6320)

* fix: inject value maybe undefined

* fix(tag): style invalid
pull/6294/head
zkwolf 2023-02-28 21:57:11 +08:00 committed by GitHub
parent f85485e733
commit eda7247c2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 9 deletions

View File

@ -323,7 +323,7 @@ const Cascader = defineComponent({
getTransitionDirection(placement.value), getTransitionDirection(placement.value),
transitionName, transitionName,
)} )}
getPopupContainer={getPopupContainer.value} getPopupContainer={getPopupContainer?.value}
customSlots={{ customSlots={{
...slots, ...slots,
checkable: () => <span class={`${cascaderPrefixCls.value}-checkbox-inner`} />, checkable: () => <span class={`${cascaderPrefixCls.value}-checkbox-inner`} />,

View File

@ -148,7 +148,7 @@ const Drawer = defineComponent({
const [wrapSSR, hashId] = useStyle(prefixCls); const [wrapSSR, hashId] = useStyle(prefixCls);
const getContainer = computed(() => const getContainer = computed(() =>
// false // false
props.getContainer === undefined && getPopupContainer.value props.getContainer === undefined && getPopupContainer?.value
? () => getPopupContainer.value(document.body) ? () => getPopupContainer.value(document.body)
: props.getContainer, : props.getContainer,
); );

View File

@ -43,7 +43,7 @@ const Image = defineComponent<ImageProps>({
}); });
return () => { return () => {
const imageLocale = configProvider.locale.value?.Image || defaultLocale.Image; const imageLocale = configProvider.locale?.value?.Image || defaultLocale.Image;
const defaultPreviewMask = () => ( const defaultPreviewMask = () => (
<div class={`${prefixCls.value}-mask-info`}> <div class={`${prefixCls.value}-mask-info`}>
<EyeOutlined /> <EyeOutlined />

View File

@ -56,7 +56,7 @@ const PageHeader = defineComponent({
compact.value = width < 768; compact.value = width < 768;
} }
}; };
const ghost = computed(() => props.ghost ?? pageHeader.value?.ghost ?? true); const ghost = computed(() => props.ghost ?? pageHeader?.value?.ghost ?? true);
const getBackIcon = () => { const getBackIcon = () => {
return ( return (

View File

@ -266,7 +266,7 @@ const Select = defineComponent({
dropdownMatchSelectWidth={dropdownMatchSelectWidth} dropdownMatchSelectWidth={dropdownMatchSelectWidth}
{...selectProps} {...selectProps}
{...attrs} {...attrs}
showSearch={props.showSearch ?? select.value?.showSearch} showSearch={props.showSearch ?? select?.value?.showSearch}
placeholder={placeholder} placeholder={placeholder}
listHeight={listHeight} listHeight={listHeight}
listItemHeight={listItemHeight} listItemHeight={listItemHeight}
@ -279,7 +279,7 @@ const Select = defineComponent({
clearIcon={clearIcon} clearIcon={clearIcon}
notFoundContent={mergedNotFound} notFoundContent={mergedNotFound}
class={[mergedClassName.value, attrs.class]} class={[mergedClassName.value, attrs.class]}
getPopupContainer={getPopupContainer.value} getPopupContainer={getPopupContainer?.value}
dropdownClassName={rcSelectRtlDropdownClassName} dropdownClassName={rcSelectRtlDropdownClassName}
onChange={triggerChange} onChange={triggerChange}
onBlur={handleBlur} onBlur={handleBlur}

View File

@ -1,4 +1,4 @@
import type { HTMLAttributes, App, PropType, ExtractPropTypes, Plugin } from 'vue'; import type { HTMLAttributes, App, PropType, ExtractPropTypes, Plugin, CSSProperties } from 'vue';
import { ref, defineComponent, watchEffect, computed } from 'vue'; import { ref, defineComponent, watchEffect, computed } from 'vue';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
@ -133,7 +133,11 @@ const Tag = defineComponent({
const isNeedWave = 'onClick' in attrs; const isNeedWave = 'onClick' in attrs;
const tagNode = ( const tagNode = (
<span {...attrs} class={tagClassName.value} style={tagStyle}> <span
{...attrs}
class={tagClassName.value}
style={[tagStyle, attrs.style as CSSProperties]}
>
{kids} {kids}
{renderCloseIcon()} {renderCloseIcon()}
</span> </span>

View File

@ -314,7 +314,7 @@ const TreeSelect = defineComponent({
} }
showTreeIcon={treeIcon as any} showTreeIcon={treeIcon as any}
notFoundContent={mergedNotFound} notFoundContent={mergedNotFound}
getPopupContainer={getPopupContainer.value} getPopupContainer={getPopupContainer?.value}
treeMotion={null} treeMotion={null}
dropdownClassName={mergedDropdownClassName.value} dropdownClassName={mergedDropdownClassName.value}
choiceTransitionName={choiceTransitionName.value} choiceTransitionName={choiceTransitionName.value}