Skip to content

Commit 0ed147d

Browse files
authored
fix(runtime-dom): v-cloak should be removed after compile on the root element (#893)
fix #890
1 parent f924bd6 commit 0ed147d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createApp } from '@vue/runtime-dom'
2+
3+
describe('vCloak', () => {
4+
test('should be removed after compile', () => {
5+
const root = document.createElement('div')
6+
root.setAttribute('v-cloak', '')
7+
createApp({}).mount(root)
8+
expect(root.hasAttribute('v-cloak')).toBe(false)
9+
})
10+
})

packages/runtime-dom/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export const createApp = ((...args) => {
6363
}
6464
// clear content before mounting
6565
container.innerHTML = ''
66-
return mount(container)
66+
const proxy = mount(container)
67+
container.removeAttribute('v-cloak')
68+
return proxy
6769
}
6870

6971
return app

0 commit comments

Comments
 (0)