Просмотр исходного кода

feat: interop with object syntax in all builds

Evan You 7 лет назад
Родитель
Сommit
848b92070b
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      packages/core/src/optional/keepAlive.ts
  2. 1 1
      packages/core/src/vdom.ts

+ 2 - 2
packages/core/src/optional/keepAlive.ts

@@ -49,7 +49,7 @@ export class KeepAlive extends Component<{}, KeepAliveProps> {
     this.keys.delete(key)
   }
 
-  render(_: any, { props, slots }: { props: any; slots: Slots }) {
+  render(_: any, { props, slots }: { props: KeepAliveProps; slots: Slots }) {
     if (!slots.default) {
       return
     }
@@ -98,7 +98,7 @@ export class KeepAlive extends Component<{}, KeepAliveProps> {
     } else {
       keys.add(key)
       // prune oldest entry
-      if (max && keys.size > parseInt(max, 10)) {
+      if (max && keys.size > parseInt(max as string, 10)) {
         this.pruneCacheEntry(Array.from(this.keys)[0])
       }
     }

+ 1 - 1
packages/core/src/vdom.ts

@@ -128,7 +128,7 @@ export function createComponentVNode(
 
   // flags
   const compType = typeof comp
-  if (__COMPAT__ && compType === 'object') {
+  if (compType === 'object') {
     if (comp.functional) {
       // object literal functional
       flags = VNodeFlags.COMPONENT_FUNCTIONAL