fix(runtime-dom): support mounting app to svg container (#2929)

fix #2926
This commit is contained in:
HcySunYang
2021-03-02 00:51:32 +08:00
committed by GitHub
parent 1a955e2278
commit 8ffcde2836
5 changed files with 44 additions and 9 deletions

View File

@@ -69,7 +69,7 @@ export const createApp = ((...args) => {
}
// clear content before mounting
container.innerHTML = ''
const proxy = mount(container)
const proxy = mount(container, false, container instanceof SVGElement)
if (container instanceof Element) {
container.removeAttribute('v-cloak')
container.setAttribute('data-v-app', '')
@@ -92,7 +92,7 @@ export const createSSRApp = ((...args) => {
app.mount = (containerOrSelector: Element | ShadowRoot | string): any => {
const container = normalizeContainer(containerOrSelector)
if (container) {
return mount(container, true)
return mount(container, true, container instanceof SVGElement)
}
}