Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/cascader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const Cascader = defineComponent({
getTransitionDirection(placement.value),
transitionName,
)}
getPopupContainer={getPopupContainer.value}
getPopupContainer={getPopupContainer?.value}
customSlots={{
...slots,
checkable: () => <span class={`${cascaderPrefixCls.value}-checkbox-inner`} />,
Expand Down
2 changes: 1 addition & 1 deletion components/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Drawer = defineComponent({
const [wrapSSR, hashId] = useStyle(prefixCls);
const getContainer = computed(() =>
// 有可能为 false,所以不能直接判断
props.getContainer === undefined && getPopupContainer.value
props.getContainer === undefined && getPopupContainer?.value
? () => getPopupContainer.value(document.body)
: props.getContainer,
);
Expand Down
2 changes: 1 addition & 1 deletion components/image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Image = defineComponent<ImageProps>({
});

return () => {
const imageLocale = configProvider.locale.value?.Image || defaultLocale.Image;
const imageLocale = configProvider.locale?.value?.Image || defaultLocale.Image;
const defaultPreviewMask = () => (
<div class={`${prefixCls.value}-mask-info`}>
<EyeOutlined />
Expand Down
2 changes: 1 addition & 1 deletion components/page-header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const PageHeader = defineComponent({
compact.value = width < 768;
}
};
const ghost = computed(() => props.ghost ?? pageHeader.value?.ghost ?? true);
const ghost = computed(() => props.ghost ?? pageHeader?.value?.ghost ?? true);

const getBackIcon = () => {
return (
Expand Down
4 changes: 2 additions & 2 deletions components/select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const Select = defineComponent({
dropdownMatchSelectWidth={dropdownMatchSelectWidth}
{...selectProps}
{...attrs}
showSearch={props.showSearch ?? select.value?.showSearch}
showSearch={props.showSearch ?? select?.value?.showSearch}
placeholder={placeholder}
listHeight={listHeight}
listItemHeight={listItemHeight}
Expand All @@ -279,7 +279,7 @@ const Select = defineComponent({
clearIcon={clearIcon}
notFoundContent={mergedNotFound}
class={[mergedClassName.value, attrs.class]}
getPopupContainer={getPopupContainer.value}
getPopupContainer={getPopupContainer?.value}
dropdownClassName={rcSelectRtlDropdownClassName}
onChange={triggerChange}
onBlur={handleBlur}
Expand Down
8 changes: 6 additions & 2 deletions components/tag/index.tsx
Original file line number Diff line number Diff line change
@@ -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 classNames from '../_util/classNames';
import PropTypes from '../_util/vue-types';
Expand Down Expand Up @@ -133,7 +133,11 @@ const Tag = defineComponent({
const isNeedWave = 'onClick' in attrs;

const tagNode = (
<span {...attrs} class={tagClassName.value} style={tagStyle}>
<span
{...attrs}
class={tagClassName.value}
style={[tagStyle, attrs.style as CSSProperties]}
>
{kids}
{renderCloseIcon()}
</span>
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const TreeSelect = defineComponent({
}
showTreeIcon={treeIcon as any}
notFoundContent={mergedNotFound}
getPopupContainer={getPopupContainer.value}
getPopupContainer={getPopupContainer?.value}
treeMotion={null}
dropdownClassName={mergedDropdownClassName.value}
choiceTransitionName={choiceTransitionName.value}
Expand Down