Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): avoid passing attrs to default slot for ClientOnly (#8921)
Browse files Browse the repository at this point in the history
  • Loading branch information
huang-julien authored and danielroe committed Jan 21, 2023
1 parent 854d52b commit 92d2653
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nuxt/src/app/components/client-only.mjs
Expand Up @@ -2,9 +2,10 @@ import { ref, onMounted, defineComponent, createElementBlock, h, createElementVN

export default defineComponent({
name: 'ClientOnly',
inheritAttrs: false,
// eslint-disable-next-line vue/require-prop-types
props: ['fallback', 'placeholder', 'placeholderTag', 'fallbackTag'],
setup (_, { slots }) {
setup (_, { slots, attrs }) {
const mounted = ref(false)
onMounted(() => { mounted.value = true })
return (props) => {
Expand All @@ -13,7 +14,7 @@ export default defineComponent({
if (slot) { return slot() }
const fallbackStr = props.fallback || props.placeholder || ''
const fallbackTag = props.fallbackTag || props.placeholderTag || 'span'
return createElementBlock(fallbackTag, null, fallbackStr)
return createElementBlock(fallbackTag, attrs, fallbackStr)
}
}
})
Expand Down

0 comments on commit 92d2653

Please sign in to comment.