feat(runtime-core): support app.unmount(container) (#601)

close #593
This commit is contained in:
likui
2020-01-17 01:23:47 +08:00
committed by Evan You
parent 8ec69cbc3f
commit 04ac6c467a
3 changed files with 38 additions and 1 deletions

View File

@@ -46,6 +46,26 @@ describe('api: createApp', () => {
expect(`already been mounted`).toHaveBeenWarned()
})
test('unmount', () => {
const Comp = {
props: {
count: {
default: 0
}
},
setup(props: { count: number }) {
return () => props.count
}
}
const root = nodeOps.createElement('div')
const app = createApp()
app.mount(Comp, root)
app.unmount(root)
expect(serializeInner(root)).toBe(``)
})
test('provide', () => {
const app = createApp()
app.provide('foo', 1)