mirror of https://github.com/vuejs/core.git
chore: update
This commit is contained in:
parent
913af4c543
commit
b7e11639d5
|
@ -19,6 +19,7 @@ import {
|
||||||
ShapeFlags,
|
ShapeFlags,
|
||||||
def,
|
def,
|
||||||
getEscapedCssVarName,
|
getEscapedCssVarName,
|
||||||
|
hasOwn,
|
||||||
includeBooleanAttr,
|
includeBooleanAttr,
|
||||||
isBooleanAttr,
|
isBooleanAttr,
|
||||||
isKnownHtmlAttr,
|
isKnownHtmlAttr,
|
||||||
|
@ -677,7 +678,7 @@ export function createHydrationFunctions(
|
||||||
): Node | null => {
|
): Node | null => {
|
||||||
if (
|
if (
|
||||||
!isMismatchAllowed(node.parentElement!, MismatchTypes.CHILDREN) &&
|
!isMismatchAllowed(node.parentElement!, MismatchTypes.CHILDREN) &&
|
||||||
!isCommentNodeMismatch(node, vnode)
|
!isMismatchAllowedForCommentNode(node, vnode)
|
||||||
) {
|
) {
|
||||||
;(__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) &&
|
;(__DEV__ || __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) &&
|
||||||
warn(
|
warn(
|
||||||
|
@ -998,10 +999,13 @@ function isMismatchAllowed(
|
||||||
}
|
}
|
||||||
|
|
||||||
// data-allow-mismatch + v-if
|
// data-allow-mismatch + v-if
|
||||||
function isCommentNodeMismatch(node: Node, vnode: VNode): boolean {
|
function isMismatchAllowedForCommentNode(
|
||||||
if (node.nodeType !== DOMNodeTypes.COMMENT || !vnode.props) {
|
node: Node,
|
||||||
return false
|
{ props }: VNode,
|
||||||
}
|
): boolean {
|
||||||
|
return (
|
||||||
return allowMismatchAttr in vnode.props
|
node.nodeType === DOMNodeTypes.COMMENT &&
|
||||||
|
props != null &&
|
||||||
|
hasOwn(props, allowMismatchAttr)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue