mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
fix(nuxt): apply scoped styles to islands (#23386)
This commit is contained in:
parent
9da77db358
commit
17e6c1f7fb
@ -50,7 +50,8 @@ export default defineComponent({
|
||||
const error = ref<unknown>(null)
|
||||
const config = useRuntimeConfig()
|
||||
const nuxtApp = useNuxtApp()
|
||||
const hashId = computed(() => hash([props.name, props.props, props.context, props.source]))
|
||||
const filteredProps = computed(() => props.props ? Object.fromEntries(Object.entries(props.props).filter(([key]) => !key.startsWith('data-v-'))) : {})
|
||||
const hashId = computed(() => hash([props.name, filteredProps.value, props.context, props.source]))
|
||||
const instance = getCurrentInstance()!
|
||||
const event = useRequestEvent()
|
||||
// TODO: remove use of `$fetch.raw` when nitro 503 issues on windows dev server are resolved
|
||||
|
@ -11,8 +11,7 @@ export const createServerComponent = (name: string) => {
|
||||
return h(NuxtIsland, {
|
||||
name,
|
||||
lazy: props.lazy,
|
||||
// #23051 - remove data-v attributes
|
||||
props: Object.fromEntries(Object.entries(attrs).filter(([key]) => !key.startsWith('data-v-')))
|
||||
props: attrs
|
||||
}, slots)
|
||||
}
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ describe('runtime server component', () => {
|
||||
expect(h).toHaveBeenCalledOnce()
|
||||
if (!vi.mocked(h).mock.lastCall) { throw new Error('no last call') }
|
||||
expect(vi.mocked(h).mock.lastCall![1]?.props).toBeTypeOf('object')
|
||||
expect(Object.keys(vi.mocked(h).mock.lastCall![1]?.props)).not.toContain('data-v-123')
|
||||
expect(vi.mocked(h).mock.lastCall![1]?.props).toMatchInlineSnapshot(`
|
||||
{
|
||||
"data-v-123": "",
|
||||
"test": 1,
|
||||
}
|
||||
`)
|
||||
|
Loading…
Reference in New Issue
Block a user