types: rename

This commit is contained in:
Evan You
2018-10-09 11:37:24 -04:00
parent d22b71b27e
commit e698c8f492
13 changed files with 118 additions and 100 deletions

View File

@@ -1,8 +1,8 @@
import { VNode } from '../vdom'
import { MountedComponent } from '../component'
import { ComponentInstance } from '../component'
interface DirectiveBinding {
instance: MountedComponent
instance: ComponentInstance
value?: any
oldValue?: any
arg?: string
@@ -32,7 +32,7 @@ const valueCache = new WeakMap<Directive, WeakMap<any, any>>()
export function applyDirective(
vnode: VNode,
directive: Directive,
instance: MountedComponent,
instance: ComponentInstance,
value?: any,
arg?: string,
modifiers?: DirectiveModifiers

View File

@@ -1,4 +1,4 @@
import { Component, ComponentClass, MountedComponent } from '../component'
import { Component, ComponentClass, ComponentInstance } from '../component'
import { VNode, Slots, cloneVNode } from '../vdom'
import { VNodeFlags } from '../flags'
@@ -20,13 +20,13 @@ export class KeepAlive extends Component<KeepAliveProps> {
keys: Set<CacheKey> = new Set()
// to be set in createRenderer when instance is created
$unmount: (instance: MountedComponent) => void
$unmount: (instance: ComponentInstance) => void
beforeUnmount() {
this.cache.forEach(vnode => {
// change flag so it can be properly unmounted
vnode.flags = VNodeFlags.COMPONENT_STATEFUL_NORMAL
this.$unmount(vnode.children as MountedComponent)
this.$unmount(vnode.children as ComponentInstance)
})
}
@@ -43,7 +43,7 @@ export class KeepAlive extends Component<KeepAliveProps> {
const cached = this.cache.get(key) as VNode
const current = this.$vnode
if (!current || cached.tag !== current.tag) {
this.$unmount(cached.children as MountedComponent)
this.$unmount(cached.children as ComponentInstance)
}
this.cache.delete(key)
this.keys.delete(key)