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
2 changes: 1 addition & 1 deletion src/core/vdom/create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function _createElement (
let vnode, ns
if (typeof tag === 'string') {
let Ctor
ns = config.getTagNamespace(tag)
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag)
if (config.isReservedTag(tag)) {
// platform built-in elements
vnode = new VNode(
Expand Down
18 changes: 18 additions & 0 deletions test/unit/modules/vdom/create-element.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ describe('create-element', () => {
expect(vnode.children[0].children[0].ns).toBeUndefined()
})

// #6506
it('render SVGAElement in a component correctly', () => {
const vm = new Vue({
template: `
<svg>
<test></test>
</svg>
`,
components: {
test: { render: h => h('a') }
}
}).$mount()
const testComp = vm.$children[0]
expect(testComp.$vnode.ns).toBe('svg')
expect(testComp._vnode.tag).toBe('a')
expect(testComp._vnode.ns).toBe('svg')
})

it('warn observed data objects', () => {
new Vue({
data: {
Expand Down