content icon indicating copy to clipboard operation
content copied to clipboard

`<Markdown>` can’t detect changes in parent slots with slot name

Open farnabaz opened this issue 4 years ago • 0 comments

Using <Markdown use=“slot-name”> component with slots name has limitation, due to Vue rendering.

On second and further renders <Markdown> component will not receive updated value for slots. This will break the content hot reload and changes will not apply to rendered html unless user forces page reload.

At the time it is recommended to use <Markdown> component with slot references instead of slot name. Passing slot reference will resolve the HMR issue.

- <Markdown />
+ <Markdown :use=“$slots.default” />

- <Markdown use=“custom-slot” />
+ <Markdown :use=“$slots.customSlot” />

farnabaz avatar May 09 '22 08:05 farnabaz