Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/vnodeTransformers/stubComponentsTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ const createDefaultStub = (
if (kebabTag in stubs && stubs[kebabTag] === false) return type
if (pascalTag in stubs && stubs[pascalTag] === false) return type

return createStub({
name: kebabTag,
type,
renderStubDefaultSlot: true
})
if (stubs[kebabTag] === true || stubs[pascalTag] === true) {
return createStub({
name: kebabTag,
type,
renderStubDefaultSlot: true
})
}
}
}

Expand Down
18 changes: 18 additions & 0 deletions tests/mountingOptions/global.stubs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,24 @@ describe('mounting options: stubs', () => {
'</transition-stub>'
)
})

it('custom transition stub', () => {
const Comp = {
template: `<transition><div id="content-custom-stub" /></transition>`
}
config.global.stubs = {
transition: {
template: '<div class="custom-transition-stub"><slot /></div>'
}
}
const wrapper = mount(Comp)

expect(wrapper.html()).toBe(
'<div class="custom-transition-stub">\n' +
' <div id="content-custom-stub"></div>\n' +
'</div>'
)
})
})

describe('transition-group', () => {
Expand Down