Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
9016f7d5
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9016f7d5
编写于
9月 28, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: bump vue from 3.2.39 to 3.2.40
上级
a31dc465
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
67 addition
and
68 deletion
+67
-68
packages/uni-app-vue/lib/nvue.runtime.esm.js
packages/uni-app-vue/lib/nvue.runtime.esm.js
+67
-68
未找到文件。
packages/uni-app-vue/lib/nvue.runtime.esm.js
浏览文件 @
9016f7d5
...
...
@@ -2723,7 +2723,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
const
createHook
=
(
lifecycle
)
=>
(
hook
,
target
=
currentInstance
)
=>
// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
(
!
isInSSRComponentSetup
||
lifecycle
===
"
sp
"
/* LifecycleHooks.SERVER_PREFETCH */
)
&&
injectHook
(
lifecycle
,
hook
,
target
);
injectHook
(
lifecycle
,
(...
args
)
=>
hook
(...
args
)
,
target
);
const
onBeforeMount
=
createHook
(
"
bm
"
/* LifecycleHooks.BEFORE_MOUNT */
);
const
onMounted
=
createHook
(
"
m
"
/* LifecycleHooks.MOUNTED */
);
const
onBeforeUpdate
=
createHook
(
"
bu
"
/* LifecycleHooks.BEFORE_UPDATE */
);
...
...
@@ -2946,7 +2946,10 @@ function createSlots(slots, dynamicSlots) {
slots
[
slot
.
name
]
=
slot
.
key
?
(...
args
)
=>
{
const
res
=
slot
.
fn
(...
args
);
res
.
key
=
slot
.
key
;
// attach branch key so each conditional branch is considered a
// different fragment
if
(
res
)
res
.
key
=
slot
.
key
;
return
res
;
}
:
slot
.
fn
;
...
...
@@ -4620,7 +4623,7 @@ function createHydrationFunctions(rendererInternals) {
const
isFragmentStart
=
isComment
(
node
)
&&
node
.
data
===
'
[
'
;
const
onMismatch
=
()
=>
handleMismatch
(
node
,
vnode
,
parentComponent
,
parentSuspense
,
slotScopeIds
,
isFragmentStart
);
const
{
type
,
ref
,
shapeFlag
,
patchFlag
}
=
vnode
;
cons
t
domType
=
node
.
nodeType
;
le
t
domType
=
node
.
nodeType
;
vnode
.
el
=
node
;
if
(
patchFlag
===
-
2
/* PatchFlags.BAIL */
)
{
optimized
=
false
;
...
...
@@ -4661,10 +4664,12 @@ function createHydrationFunctions(rendererInternals) {
}
break
;
case
Static
:
if
(
domType
!==
1
/* DOMNodeTypes.ELEMENT */
&&
domType
!==
3
/* DOMNodeTypes.TEXT */
)
{
nextNode
=
onMismatch
();
if
(
isFragmentStart
)
{
// entire template is static but SSRed as a fragment
node
=
nextSibling
(
node
);
domType
=
node
.
nodeType
;
}
else
{
if
(
domType
===
1
/* DOMNodeTypes.ELEMENT */
||
domType
===
3
/* DOMNodeTypes.TEXT */
)
{
// determine anchor, adopt content
nextNode
=
node
;
// if the static vnode has its content stripped during build,
...
...
@@ -4681,7 +4686,10 @@ function createHydrationFunctions(rendererInternals) {
}
nextNode
=
nextSibling
(
nextNode
);
}
return
nextNode
;
return
isFragmentStart
?
nextSibling
(
nextNode
)
:
nextNode
;
}
else
{
onMismatch
();
}
break
;
case
Fragment
:
...
...
@@ -5040,7 +5048,7 @@ function baseCreateRenderer(options, createHydrationFns) {
setDevtoolsHook
(
target
.
__VUE_DEVTOOLS_GLOBAL_HOOK__
,
target
);
}
const
{
insert
:
hostInsert
,
remove
:
hostRemove
,
patchProp
:
hostPatchProp
,
forcePatchProp
:
hostForcePatchProp
,
// fixed by xxxxxx
createElement
:
hostCreateElement
,
createText
:
hostCreateText
,
createComment
:
hostCreateComment
,
setText
:
hostSetText
,
setElementText
:
hostSetElementText
,
parentNode
:
hostParentNode
,
nextSibling
:
hostNextSibling
,
setScopeId
:
hostSetScopeId
=
NOOP
,
cloneNode
:
hostCloneNode
,
insertStaticContent
:
hostInsertStaticContent
}
=
options
;
createElement
:
hostCreateElement
,
createText
:
hostCreateText
,
createComment
:
hostCreateComment
,
setText
:
hostSetText
,
setElementText
:
hostSetElementText
,
parentNode
:
hostParentNode
,
nextSibling
:
hostNextSibling
,
setScopeId
:
hostSetScopeId
=
NOOP
,
insertStaticContent
:
hostInsertStaticContent
}
=
options
;
// Note: functions inside this closure should use `const xxx = () => {}`
// style in order to prevent being inlined by minifiers.
const
patch
=
(
n1
,
n2
,
container
,
anchor
=
null
,
parentComponent
=
null
,
parentSuspense
=
null
,
isSVG
=
false
,
slotScopeIds
=
null
,
optimized
=
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
isHmrUpdating
?
false
:
!!
n2
.
dynamicChildren
)
=>
{
...
...
@@ -5167,61 +5175,49 @@ function baseCreateRenderer(options, createHydrationFns) {
const
mountElement
=
(
vnode
,
container
,
anchor
,
parentComponent
,
parentSuspense
,
isSVG
,
slotScopeIds
,
optimized
)
=>
{
let
el
;
let
vnodeHook
;
const
{
type
,
props
,
shapeFlag
,
transition
,
patchFlag
,
dirs
}
=
vnode
;
if
(
!
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
vnode
.
el
&&
hostCloneNode
!==
undefined
&&
patchFlag
===
-
1
/* PatchFlags.HOISTED */
)
{
// If a vnode has non-null el, it means it's being reused.
// Only static vnodes can be reused, so its mounted DOM nodes should be
// exactly the same, and we can simply do a clone here.
// only do this in production since cloned trees cannot be HMR updated.
el
=
vnode
.
el
=
hostCloneNode
(
vnode
.
el
);
const
{
type
,
props
,
shapeFlag
,
transition
,
dirs
}
=
vnode
;
el
=
vnode
.
el
=
hostCreateElement
(
vnode
.
type
,
isSVG
,
props
&&
props
.
is
,
props
);
// mount children first, since some props may rely on child content
// being already rendered, e.g. `<select value>`
if
(
shapeFlag
&
8
/* ShapeFlags.TEXT_CHILDREN */
)
{
hostSetElementText
(
el
,
vnode
.
children
);
}
else
{
el
=
vnode
.
el
=
hostCreateElement
(
vnode
.
type
,
isSVG
,
props
&&
props
.
is
,
props
);
// mount children first, since some props may rely on child content
// being already rendered, e.g. `<select value>`
if
(
shapeFlag
&
8
/* ShapeFlags.TEXT_CHILDREN */
)
{
hostSetElementText
(
el
,
vnode
.
children
);
}
else
if
(
shapeFlag
&
16
/* ShapeFlags.ARRAY_CHILDREN */
)
{
mountChildren
(
vnode
.
children
,
el
,
null
,
parentComponent
,
parentSuspense
,
isSVG
&&
type
!==
'
foreignObject
'
,
slotScopeIds
,
optimized
);
}
if
(
dirs
)
{
invokeDirectiveHook
(
vnode
,
null
,
parentComponent
,
'
created
'
);
}
// props
if
(
props
)
{
for
(
const
key
in
props
)
{
if
(
key
!==
'
value
'
&&
!
isReservedProp
(
key
))
{
hostPatchProp
(
el
,
key
,
null
,
props
[
key
],
isSVG
,
vnode
.
children
,
parentComponent
,
parentSuspense
,
unmountChildren
,
// fixed by xxxxxx
vnode
.
hostInstance
);
}
}
/**
* Special case for setting value on DOM elements:
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
* - it needs to be forced (#1471)
* #2353 proposes adding another renderer option to configure this, but
* the properties affects are so finite it is worth special casing it
* here to reduce the complexity. (Special casing it also should not
* affect non-DOM renderers)
*/
if
(
'
value
'
in
props
)
{
// fixed by xxxxxx
hostPatchProp
(
el
,
'
value
'
,
null
,
props
.
value
,
false
,
[],
parentComponent
,
null
,
undefined
,
else
if
(
shapeFlag
&
16
/* ShapeFlags.ARRAY_CHILDREN */
)
{
mountChildren
(
vnode
.
children
,
el
,
null
,
parentComponent
,
parentSuspense
,
isSVG
&&
type
!==
'
foreignObject
'
,
slotScopeIds
,
optimized
);
}
if
(
dirs
)
{
invokeDirectiveHook
(
vnode
,
null
,
parentComponent
,
'
created
'
);
}
// props
if
(
props
)
{
for
(
const
key
in
props
)
{
if
(
key
!==
'
value
'
&&
!
isReservedProp
(
key
))
{
hostPatchProp
(
el
,
key
,
null
,
props
[
key
],
isSVG
,
vnode
.
children
,
parentComponent
,
parentSuspense
,
unmountChildren
,
// fixed by xxxxxx
vnode
.
hostInstance
);
}
if
((
vnodeHook
=
props
.
onVnodeBeforeMount
))
{
invokeVNodeHook
(
vnodeHook
,
parentComponent
,
vnode
);
}
}
// scopeId
setScopeId
(
el
,
vnode
,
vnode
.
scopeId
,
slotScopeIds
,
parentComponent
);
/**
* Special case for setting value on DOM elements:
* - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)
* - it needs to be forced (#1471)
* #2353 proposes adding another renderer option to configure this, but
* the properties affects are so finite it is worth special casing it
* here to reduce the complexity. (Special casing it also should not
* affect non-DOM renderers)
*/
if
(
'
value
'
in
props
)
{
// fixed by xxxxxx
hostPatchProp
(
el
,
'
value
'
,
null
,
props
.
value
,
false
,
[],
parentComponent
,
null
,
undefined
,
// fixed by xxxxxx
vnode
.
hostInstance
);
}
if
((
vnodeHook
=
props
.
onVnodeBeforeMount
))
{
invokeVNodeHook
(
vnodeHook
,
parentComponent
,
vnode
);
}
}
// scopeId
setScopeId
(
el
,
vnode
,
vnode
.
scopeId
,
slotScopeIds
,
parentComponent
);
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
||
__VUE_PROD_DEVTOOLS__
)
{
Object
.
defineProperty
(
el
,
'
__vnode
'
,
{
value
:
vnode
,
...
...
@@ -5419,6 +5415,15 @@ function baseCreateRenderer(options, createHydrationFns) {
};
const
patchProps
=
(
el
,
vnode
,
oldProps
,
newProps
,
parentComponent
,
parentSuspense
,
isSVG
)
=>
{
if
(
oldProps
!==
newProps
)
{
if
(
oldProps
!==
EMPTY_OBJ
)
{
for
(
const
key
in
oldProps
)
{
if
(
!
isReservedProp
(
key
)
&&
!
(
key
in
newProps
))
{
hostPatchProp
(
el
,
key
,
oldProps
[
key
],
null
,
isSVG
,
vnode
.
children
,
parentComponent
,
parentSuspense
,
unmountChildren
,
// fixed by xxxxxx
vnode
.
hostInstance
);
}
}
}
for
(
const
key
in
newProps
)
{
// empty string is not valid prop
if
(
isReservedProp
(
key
))
...
...
@@ -5434,15 +5439,6 @@ function baseCreateRenderer(options, createHydrationFns) {
vnode
.
hostInstance
);
}
}
if
(
oldProps
!==
EMPTY_OBJ
)
{
for
(
const
key
in
oldProps
)
{
if
(
!
isReservedProp
(
key
)
&&
!
(
key
in
newProps
))
{
hostPatchProp
(
el
,
key
,
oldProps
[
key
],
null
,
isSVG
,
vnode
.
children
,
parentComponent
,
parentSuspense
,
unmountChildren
,
// fixed by xxxxxx
vnode
.
hostInstance
);
}
}
}
if
(
'
value
'
in
newProps
)
{
// fixed by xxxxxx
hostPatchProp
(
el
,
'
value
'
,
oldProps
.
value
,
newProps
.
value
,
false
,
[],
parentComponent
,
null
,
undefined
,
...
...
@@ -6980,7 +6976,10 @@ function normalizeVNode(child) {
}
// optimized normalization for template-compiled render fns
function
cloneIfMounted
(
child
)
{
return
child
.
el
===
null
||
child
.
memo
?
child
:
cloneVNode
(
child
);
return
(
child
.
el
===
null
&&
child
.
patchFlag
!==
-
1
/* PatchFlags.HOISTED */
)
||
child
.
memo
?
child
:
cloneVNode
(
child
);
}
function
normalizeChildren
(
vnode
,
children
)
{
let
type
=
0
;
...
...
@@ -7906,7 +7905,7 @@ function isMemoSame(cached, memo) {
}
// Core API ------------------------------------------------------------------
const
version
=
"
3.2.
39
"
;
const
version
=
"
3.2.
40
"
;
/**
* @internal only exposed in compat builds
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录