Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
5d3bbd9a
U
uni-app
项目概览
DCloud
/
uni-app
4 个月 前同步成功
通知
730
Star
38707
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5d3bbd9a
编写于
12月 01, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build(mp): bump vue from 3.0.2 to 3.0.3
上级
ba1deaa1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
81 addition
and
32 deletion
+81
-32
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+81
-32
未找到文件。
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
5d3bbd9a
...
...
@@ -238,7 +238,7 @@ function createGetter(isReadonly = false, shallow = false) {
return
target
;
}
const
targetIsArray
=
isArray
(
target
);
if
(
targetIsArray
&&
hasOwn
(
arrayInstrumentations
,
key
))
{
if
(
!
isReadonly
&&
targetIsArray
&&
hasOwn
(
arrayInstrumentations
,
key
))
{
return
Reflect
.
get
(
arrayInstrumentations
,
key
,
receiver
);
}
const
res
=
Reflect
.
get
(
target
,
key
,
receiver
);
...
...
@@ -393,11 +393,11 @@ function add(value) {
const
target
=
toRaw
(
this
);
const
proto
=
getProto
(
target
);
const
hadKey
=
proto
.
has
.
call
(
target
,
value
);
const
result
=
target
.
add
(
value
);
target
.
add
(
value
);
if
(
!
hadKey
)
{
trigger
(
target
,
"
add
"
/* ADD */
,
value
,
value
);
}
return
result
;
return
this
;
}
function
set
$1
(
key
,
value
)
{
value
=
toRaw
(
value
);
...
...
@@ -412,14 +412,14 @@ function set$1(key, value) {
checkIdentityKeys
(
target
,
has
,
key
);
}
const
oldValue
=
get
.
call
(
target
,
key
);
const
result
=
target
.
set
(
key
,
value
);
target
.
set
(
key
,
value
);
if
(
!
hadKey
)
{
trigger
(
target
,
"
add
"
/* ADD */
,
key
,
value
);
}
else
if
(
hasChanged
(
value
,
oldValue
))
{
trigger
(
target
,
"
set
"
/* SET */
,
key
,
value
,
oldValue
);
}
return
result
;
return
this
;
}
function
deleteEntry
(
key
)
{
const
target
=
toRaw
(
this
);
...
...
@@ -630,19 +630,27 @@ function reactive(target) {
}
return
createReactiveObject
(
target
,
false
,
mutableHandlers
,
mutableCollectionHandlers
);
}
// Return a reactive-copy of the original object, where only the root level
// properties are reactive, and does NOT unwrap refs nor recursively convert
// returned properties.
/**
* Return a shallowly-reactive copy of the original object, where only the root
* level properties are reactive. It also does not auto-unwrap refs (even at the
* root level).
*/
function
shallowReactive
(
target
)
{
return
createReactiveObject
(
target
,
false
,
shallowReactiveHandlers
,
shallowCollectionHandlers
);
}
/**
* Creates a readonly copy of the original object. Note the returned copy is not
* made reactive, but `readonly` can be called on an already reactive object.
*/
function
readonly
(
target
)
{
return
createReactiveObject
(
target
,
true
,
readonlyHandlers
,
readonlyCollectionHandlers
);
}
// Return a reactive-copy of the original object, where only the root level
// properties are readonly, and does NOT unwrap refs nor recursively convert
// returned properties.
// This is used for creating the props proxy object for stateful components.
/**
* Returns a reactive-copy of the original object, where only the root level
* properties are readonly, and does NOT unwrap refs nor recursively convert
* returned properties.
* This is used for creating the props proxy object for stateful components.
*/
function
shallowReadonly
(
target
)
{
return
createReactiveObject
(
target
,
true
,
shallowReadonlyHandlers
,
readonlyCollectionHandlers
);
}
...
...
@@ -1189,8 +1197,6 @@ function flushJobs(seen) {
// priority number)
// 2. If a component is unmounted during a parent component's update,
// its update can be skipped.
// Jobs can never be null before flush starts, since they are only invalidated
// during execution of another flushed job.
queue
.
sort
((
a
,
b
)
=>
getId
(
a
)
-
getId
(
b
));
try
{
for
(
flushIndex
=
0
;
flushIndex
<
queue
.
length
;
flushIndex
++
)
{
...
...
@@ -1346,13 +1352,16 @@ function isEmitListener(options, key) {
if
(
!
options
||
!
isOn
(
key
))
{
return
false
;
}
key
=
key
.
replace
(
/Once$/
,
''
);
return
(
hasOwn
(
options
,
key
[
2
].
toLowerCase
()
+
key
.
slice
(
3
))
||
hasOwn
(
options
,
key
.
slice
(
2
)));
key
=
key
.
slice
(
2
).
replace
(
/Once$/
,
''
);
return
(
hasOwn
(
options
,
key
[
0
].
toLowerCase
()
+
key
.
slice
(
1
))
||
hasOwn
(
options
,
hyphenate
(
key
))
||
hasOwn
(
options
,
key
));
}
// mark the current rendering instance for asset resolution (e.g.
// resolveComponent, resolveDirective) during render
/**
* mark the current rendering instance for asset resolution (e.g.
* resolveComponent, resolveDirective) during render
*/
let
currentRenderingInstance
=
null
;
function
markAttrsAccessed
()
{
}
...
...
@@ -2065,7 +2074,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
onTrigger
,
scheduler
});
recordInstanceBoundEffect
(
runner
);
recordInstanceBoundEffect
(
runner
,
instance
);
// initial run
if
(
cb
)
{
if
(
immediate
)
{
...
...
@@ -2193,7 +2202,9 @@ function applyOptions(instance, options, deferredData = [], deferredWatch = [],
// assets
components
,
directives
,
// lifecycle
beforeMount
,
mounted
,
beforeUpdate
,
updated
,
activated
,
deactivated
,
beforeDestroy
,
beforeUnmount
,
destroyed
,
unmounted
,
render
,
renderTracked
,
renderTriggered
,
errorCaptured
}
=
options
;
beforeMount
,
mounted
,
beforeUpdate
,
updated
,
activated
,
deactivated
,
beforeDestroy
,
beforeUnmount
,
destroyed
,
unmounted
,
render
,
renderTracked
,
renderTriggered
,
errorCaptured
,
// public API
expose
}
=
options
;
const
publicThis
=
instance
.
proxy
;
const
ctx
=
instance
.
ctx
;
const
globalMixins
=
instance
.
appContext
.
mixins
;
...
...
@@ -2352,9 +2363,9 @@ function applyOptions(instance, options, deferredData = [], deferredWatch = [],
const
provides
=
isFunction
(
provideOptions
)
?
provideOptions
.
call
(
publicThis
)
:
provideOptions
;
for
(
const
key
in
provides
)
{
Reflect
.
ownKeys
(
provides
).
forEach
(
key
=>
{
provide
(
key
,
provides
[
key
]);
}
}
);
});
}
}
...
...
@@ -2420,6 +2431,22 @@ function applyOptions(instance, options, deferredData = [], deferredWatch = [],
if
(
unmounted
)
{
onUnmounted
(
unmounted
.
bind
(
publicThis
));
}
if
(
isArray
(
expose
))
{
if
(
!
asMixin
)
{
if
(
expose
.
length
)
{
const
exposed
=
instance
.
exposed
||
(
instance
.
exposed
=
proxyRefs
({}));
expose
.
forEach
(
key
=>
{
exposed
[
key
]
=
toRef
(
publicThis
,
key
);
});
}
else
if
(
!
instance
.
exposed
)
{
instance
.
exposed
=
EMPTY_OBJ
;
}
}
else
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
warn
(
`The
\`
expose
\`
option is ignored when used in mixins.`
);
}
}
// fixed by xxxxxx
if
(
instance
.
ctx
.
$onApplyOptions
)
{
instance
.
ctx
.
$onApplyOptions
(
options
,
instance
,
publicThis
);
...
...
@@ -2562,6 +2589,12 @@ function mergeOptions(to, from, instance) {
}
}
/**
* #2437 In Vue 3, functional components do not have a public instance proxy but
* they exist in the internal parent chain. For code that relies on traversing
* public $parent chains, skip functional ones and go to the parent instead.
*/
const
getPublicInstance
=
(
i
)
=>
i
&&
(
i
.
proxy
?
i
.
proxy
:
getPublicInstance
(
i
.
parent
));
const
publicPropertiesMap
=
extend
(
Object
.
create
(
null
),
{
$
:
i
=>
i
,
$el
:
i
=>
i
.
vnode
.
el
,
...
...
@@ -2570,7 +2603,7 @@ const publicPropertiesMap = extend(Object.create(null), {
$attrs
:
i
=>
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
shallowReadonly
(
i
.
attrs
)
:
i
.
attrs
),
$slots
:
i
=>
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
shallowReadonly
(
i
.
slots
)
:
i
.
slots
),
$refs
:
i
=>
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
?
shallowReadonly
(
i
.
refs
)
:
i
.
refs
),
$parent
:
i
=>
i
.
parent
&&
i
.
parent
.
proxy
,
$parent
:
i
=>
getPublicInstance
(
i
.
parent
)
,
$root
:
i
=>
i
.
root
&&
i
.
root
.
proxy
,
$emit
:
i
=>
i
.
emit
,
$options
:
i
=>
(
__VUE_OPTIONS_API__
?
resolveMergedOptions
(
i
)
:
i
.
type
),
...
...
@@ -2831,6 +2864,7 @@ function createComponentInstance(vnode, parent, suspense) {
update
:
null
,
render
:
null
,
proxy
:
null
,
exposed
:
null
,
withProxy
:
null
,
effects
:
null
,
provides
:
parent
?
parent
.
provides
:
Object
.
create
(
appContext
.
provides
),
...
...
@@ -2973,7 +3007,9 @@ function setupStatefulComponent(instance, isSSR) {
function
handleSetupResult
(
instance
,
setupResult
,
isSSR
)
{
if
(
isFunction
(
setupResult
))
{
// setup returned an inline render function
instance
.
render
=
setupResult
;
{
instance
.
render
=
setupResult
;
}
}
else
if
(
isObject
(
setupResult
))
{
// if ((process.env.NODE_ENV !== 'production') && isVNode(setupResult)) {
...
...
@@ -3012,7 +3048,9 @@ function finishComponentSetup(instance, isSSR) {
// support for 2.x options
if
(
__VUE_OPTIONS_API__
)
{
currentInstance
=
instance
;
pauseTracking
();
applyOptions
(
instance
,
Component
);
resetTracking
();
currentInstance
=
null
;
}
// warn missing template/render
...
...
@@ -3044,10 +3082,19 @@ const attrHandlers = {
}
};
function
createSetupContext
(
instance
)
{
const
expose
=
exposed
=>
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
)
&&
instance
.
exposed
)
{
warn
(
`expose() should be called only once per setup().`
);
}
instance
.
exposed
=
proxyRefs
(
exposed
);
};
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
// We use getters in dev in case libs like test-utils overwrite instance
// properties (overwrites should not be done in prod)
return
Object
.
freeze
({
get
props
()
{
return
instance
.
props
;
},
get
attrs
()
{
return
new
Proxy
(
instance
.
attrs
,
attrHandlers
);
},
...
...
@@ -3056,22 +3103,24 @@ function createSetupContext(instance) {
},
get
emit
()
{
return
(
event
,
...
args
)
=>
instance
.
emit
(
event
,
...
args
);
}
},
expose
});
}
else
{
return
{
attrs
:
instance
.
attrs
,
slots
:
instance
.
slots
,
emit
:
instance
.
emit
emit
:
instance
.
emit
,
expose
};
}
}
// record effects created during a component's setup() so that they can be
// stopped when the component unmounts
function
recordInstanceBoundEffect
(
effect
)
{
if
(
currentI
nstance
)
{
(
currentInstance
.
effects
||
(
currentI
nstance
.
effects
=
[])).
push
(
effect
);
function
recordInstanceBoundEffect
(
effect
,
instance
=
currentInstance
)
{
if
(
i
nstance
)
{
(
instance
.
effects
||
(
i
nstance
.
effects
=
[])).
push
(
effect
);
}
}
const
classifyRE
=
/
(?:
^|
[
-_
])(\w)
/g
;
...
...
@@ -3082,7 +3131,7 @@ function formatComponentName(instance, Component, isRoot = false) {
?
Component
.
displayName
||
Component
.
name
:
Component
.
name
;
if
(
!
name
&&
Component
.
__file
)
{
const
match
=
Component
.
__file
.
match
(
/
([^/\\]
+
)\.
vue
$/
);
const
match
=
Component
.
__file
.
match
(
/
([^/\\]
+
)\.
\w
+
$/
);
if
(
match
)
{
name
=
match
[
1
];
}
...
...
@@ -3110,7 +3159,7 @@ function computed$1(getterOrOptions) {
}
// Core API ------------------------------------------------------------------
const
version
=
"
3.0.
2
"
;
const
version
=
"
3.0.
3
"
;
// import deepCopy from './deepCopy'
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录