Skip to content

Commit 7fd1f81

Browse files
committed
fix: Fix destructuring props removing reactivity
1 parent 0a640a3 commit 7fd1f81

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/runtime/components/data/CmsRichText.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default defineComponent({
5757
};
5858
}>,
5959

60-
setup({ content, as }, { attrs, slots }) {
60+
setup(props, { attrs, slots }) {
6161
function _serialize(children?: RichTextChildren): RawChildren[] | null {
6262
if (!children) return null;
6363

@@ -111,8 +111,8 @@ export default defineComponent({
111111
});
112112
}
113113

114-
const children = _serialize(content);
114+
const children = _serialize(props.content);
115115
if (!children) return h("div", { ...attrs }, "No rich text provided");
116-
return () => h(as, { ...attrs }, ...children);
116+
return () => h(props.as, { ...attrs }, ...children);
117117
},
118118
});

src/runtime/components/elements/Link.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default defineComponent<Props>({
5151

5252
// We extract the "custom" prop to avoid overrides
5353
// eslint-disable-next-line @typescript-eslint/no-unused-vars
54-
setup({ custom, ...props }, ctx) {
54+
setup(props, ctx) {
5555
const $route = useRoute();
5656

5757
function resolveLinkClass(
@@ -90,7 +90,7 @@ export default defineComponent<Props>({
9090
)
9191
: h(
9292
NuxtLink,
93-
{ custom: true, ...props },
93+
{ custom: true, ...omit(props, ["custom"]) },
9494
{
9595
default: ({
9696
route,

0 commit comments

Comments
 (0)