fix(runtime-dom): v-cloak should be removed after compile on the root element (#893)
fix #890
This commit is contained in:
parent
f924bd68bc
commit
0ed147d336
10
packages/runtime-dom/__tests__/directives/vCloak.spec.ts
Normal file
10
packages/runtime-dom/__tests__/directives/vCloak.spec.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { createApp } from '@vue/runtime-dom'
|
||||||
|
|
||||||
|
describe('vCloak', () => {
|
||||||
|
test('should be removed after compile', () => {
|
||||||
|
const root = document.createElement('div')
|
||||||
|
root.setAttribute('v-cloak', '')
|
||||||
|
createApp({}).mount(root)
|
||||||
|
expect(root.hasAttribute('v-cloak')).toBe(false)
|
||||||
|
})
|
||||||
|
})
|
@ -63,7 +63,9 @@ export const createApp = ((...args) => {
|
|||||||
}
|
}
|
||||||
// clear content before mounting
|
// clear content before mounting
|
||||||
container.innerHTML = ''
|
container.innerHTML = ''
|
||||||
return mount(container)
|
const proxy = mount(container)
|
||||||
|
container.removeAttribute('v-cloak')
|
||||||
|
return proxy
|
||||||
}
|
}
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
Loading…
Reference in New Issue
Block a user