improve ClientOnly component: pass down props

pull/4663/head
Yuxuan Zhang 5 months ago
parent 0d410d62c6
commit 6b4d214b92
No known key found for this signature in database
GPG Key ID: 6910B04F3351EF7D

@ -7,10 +7,10 @@ export const ClientOnly = defineComponent({
default: true default: true
} }
}, },
setup({ isClientOnly }, { slots }) { setup(props, { slots }) {
// Programmatically determine if this component should be // Programmatically determine if this component should be
// client-only based on the presence of the isClientOnly attribute. // client-only based on the presence of the isClientOnly attribute.
if (!isClientOnly) return () => slots.default?.() || null if (!props.isClientOnly) return () => slots.default?.(props) || null
const show = ref(false) const show = ref(false)

Loading…
Cancel
Save