Explorar el Código

fix: fix internal components render signature

Evan You hace 7 años
padre
commit
8024f058cc

+ 1 - 1
packages/core/src/optional/asyncComponent.ts

@@ -77,7 +77,7 @@ export function createAsyncComponent(
       }
     }
 
-    render(props: any, slots: Slots) {
+    render(_: any, { props, slots }: { props: any; slots: Slots }) {
       if (this.err || (this.timedOut && !this.comp)) {
         const error =
           this.err || new Error(`Async component timed out after ${timeout}ms.`)

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

@@ -31,7 +31,7 @@ export class Provide extends Component {
   beforeUpdate() {
     this.updateValue()
   }
-  render(_: any, slots: Slots) {
+  render(_: any, { slots }: { slots: Slots }) {
     return slots.default && slots.default()
   }
 }
@@ -49,7 +49,7 @@ Provide.options = {
 }
 
 export class Inject extends Component {
-  render(props: any, slots: Slots) {
+  render(_: any, { props, slots }: { props: any; slots: Slots }) {
     return slots.default && slots.default(contextStore[props.id])
   }
 }

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

@@ -49,7 +49,7 @@ export class KeepAlive extends Component<{}, KeepAliveProps> {
     this.keys.delete(key)
   }
 
-  render(props: any, slots: Slots) {
+  render(_: any, { props, slots }: { props: any; slots: Slots }) {
     if (!slots.default) {
       return
     }