Reproduce: https://codesandbox.io/s/z2m69vxnw4
const Item = {
name: "Item",
data() {
return {};
},
render() {
console.log(this.$slots);
return (
<div>
<div style="font-size: 20px">1:{this.$slots.title}</div>
<div>2:{this.$slots.default}</div>
</div>
);
}
};
const Wrapper = {
name: "Wrapper",
data() {
return {};
},
render() {
return (
<div>
----correct:-----------------------------
<Item>
<div>content</div>
<div slot="title">title</div>
</Item>
----incorrect:-----------------------------
<StyledItem>
<div>content</div>
<div slot="title">title</div>
</StyledItem>
</div>
);
}
};
const StyledItem = styled(Item)`
color: red;
`;
result:
----correct:-----------------------------
1:
title
2:
content
----incorrect:-----------------------------
1:
2:
content
title <-----expect pass to $slot.title, but actually $slots.default
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too