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

wip: pass proper args to patchDOMProp

Evan You 6 лет назад
Родитель
Сommit
42967f1f5a

+ 1 - 0
packages/runtime-core/src/index.ts

@@ -65,3 +65,4 @@ export {
   DirectiveHook,
   DirectiveHook,
   DirectiveArguments
   DirectiveArguments
 } from './directives'
 } from './directives'
+export { SuspenseBoundary } from './suspense'

+ 1 - 1
packages/runtime-dom/src/modules/props.ts

@@ -2,7 +2,7 @@ export function patchDOMProp(
   el: any,
   el: any,
   key: string,
   key: string,
   value: any,
   value: any,
-  // the next 3 args are passed only due to potential innerHTML/textContent
+  // the following args are passed only due to potential innerHTML/textContent
   // overriding existing VNodes, in which case the old tree must be properly
   // overriding existing VNodes, in which case the old tree must be properly
   // unmounted.
   // unmounted.
   prevChildren: any,
   prevChildren: any,

+ 7 - 1
packages/runtime-dom/src/patchProp.ts

@@ -4,7 +4,11 @@ import { patchAttr } from './modules/attrs'
 import { patchDOMProp } from './modules/props'
 import { patchDOMProp } from './modules/props'
 import { patchEvent } from './modules/events'
 import { patchEvent } from './modules/events'
 import { isOn } from '@vue/shared'
 import { isOn } from '@vue/shared'
-import { VNode, ComponentInternalInstance } from '@vue/runtime-core'
+import {
+  VNode,
+  ComponentInternalInstance,
+  SuspenseBoundary
+} from '@vue/runtime-core'
 
 
 export function patchProp(
 export function patchProp(
   el: Element,
   el: Element,
@@ -14,6 +18,7 @@ export function patchProp(
   isSVG: boolean,
   isSVG: boolean,
   prevChildren?: VNode[],
   prevChildren?: VNode[],
   parentComponent?: ComponentInternalInstance,
   parentComponent?: ComponentInternalInstance,
+  parentSuspense?: SuspenseBoundary<Node, Element>,
   unmountChildren?: any
   unmountChildren?: any
 ) {
 ) {
   switch (key) {
   switch (key) {
@@ -40,6 +45,7 @@ export function patchProp(
           nextValue,
           nextValue,
           prevChildren,
           prevChildren,
           parentComponent,
           parentComponent,
+          parentSuspense,
           unmountChildren
           unmountChildren
         )
         )
       } else {
       } else {