Skip to content

Commit

Permalink
fix: warn about string props
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Aug 2, 2022
1 parent 4fc3e09 commit 1617c96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/runtime/components/Markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export default defineComponent({
},
render ({ use, unwrap, fallbackSlot, between, tags, parent }) {
try {
const slot: Slot = typeof use === 'string' ? parent?.slots[use] || parent?.parent?.slots[use] : use
let slot: Slot = use
if (typeof use === 'string') {
slot = parent?.slots[use] || parent?.parent?.slots[use]
// eslint-disable-next-line no-console
console.warn(`Please set :use="$slots.${use}" in <Markdown> component to enable reactivity`)
}
if (!slot) { return fallbackSlot ? fallbackSlot() : h('div') }
Expand Down

0 comments on commit 1617c96

Please sign in to comment.