Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
luomor
uni-app
提交
3ecbc789
uni-app
项目概览
luomor
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3ecbc789
编写于
1月 08, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(v3): detect nested value changes inside props
上级
11e2bc73
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
12 deletion
+79
-12
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+31
-12
packages/uni-app-plus/dist/service.runtime.esm.js
packages/uni-app-plus/dist/service.runtime.esm.js
+48
-0
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
3ecbc789
...
...
@@ -8962,14 +8962,14 @@ var serviceContext = (function () {
'
pause
'
,
'
stop
'
,
'
ended
'
,
'
time
u
pdate
'
,
'
time
U
pdate
'
,
'
error
'
,
'
waiting
'
,
'
seeking
'
,
'
seeked
'
];
const
props
=
[
const
props
=
[
{
name
:
'
src
'
,
cache
:
true
...
...
@@ -9022,7 +9022,7 @@ var serviceContext = (function () {
this
.
_callbacks
=
{};
this
.
_options
=
{};
eventNames
.
forEach
(
name
=>
{
this
.
_callbacks
[
name
]
=
[];
this
.
_callbacks
[
name
.
toLowerCase
()
]
=
[];
});
props
.
forEach
(
item
=>
{
const
name
=
item
.
name
;
...
...
@@ -9056,11 +9056,12 @@ var serviceContext = (function () {
this
.
_operate
(
'
stop
'
);
}
seek
(
position
)
{
this
.
_operate
(
'
play
'
,
{
currentTime
:
position
this
.
_operate
(
'
seek
'
,
{
currentTime
:
position
*
1
e3
});
}
destroy
()
{
clearInterval
(
this
.
__timing
);
invokeMethod
(
'
destroyAudioInstance
'
,
{
audioId
:
this
.
id
});
...
...
@@ -9076,6 +9077,7 @@ var serviceContext = (function () {
eventNames
.
forEach
(
item
=>
{
const
name
=
item
[
0
].
toUpperCase
()
+
item
.
substr
(
1
);
item
=
item
.
toLowerCase
();
InnerAudioContext
.
prototype
[
`on
${
name
}
`
]
=
function
(
callback
)
{
this
.
_callbacks
[
item
].
push
(
callback
);
};
...
...
@@ -9088,6 +9090,17 @@ var serviceContext = (function () {
};
});
function
emit
(
audio
,
state
,
errMsg
,
errCode
)
{
audio
.
_callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
?
{
errMsg
,
errCode
}
:
{});
}
});
}
onMethod
(
'
onAudioStateChange
'
,
({
state
,
audioId
,
...
...
@@ -9095,14 +9108,20 @@ var serviceContext = (function () {
errCode
})
=>
{
const
audio
=
innerAudioContexts
[
audioId
];
audio
&&
audio
.
_callbacks
[
state
].
forEach
(
callback
=>
{
if
(
typeof
callback
===
'
function
'
)
{
callback
(
state
===
'
error
'
?
{
errMsg
,
errCode
}
:
{});
if
(
audio
)
{
emit
(
audio
,
state
,
errMsg
,
errCode
);
if
(
state
===
'
play
'
)
{
const
oldCurrentTime
=
audio
.
currentTime
;
audio
.
__timing
=
setInterval
(()
=>
{
const
currentTime
=
audio
.
currentTime
;
if
(
currentTime
!==
oldCurrentTime
)
{
emit
(
audio
,
'
timeupdate
'
);
}
},
200
);
}
else
if
(
state
===
'
pause
'
||
state
===
'
stop
'
||
state
===
'
error
'
)
{
clearInterval
(
audio
.
__timing
);
}
}
);
}
});
const
innerAudioContexts
=
Object
.
create
(
null
);
...
...
packages/uni-app-plus/dist/service.runtime.esm.js
浏览文件 @
3ecbc789
...
...
@@ -6642,6 +6642,53 @@ var baseModules = [
directives
];
/* */
function
updateWxsProps
(
oldVnode
,
vnode
)
{
if
(
isUndef
(
oldVnode
.
data
.
wxsProps
)
&&
isUndef
(
vnode
.
data
.
wxsProps
)
)
{
return
}
var
oldWxsWatches
=
oldVnode
.
$wxsWatches
;
var
wxsPropsKey
=
Object
.
keys
(
vnode
.
data
.
wxsProps
);
if
(
!
oldWxsWatches
&&
!
wxsPropsKey
.
length
)
{
return
}
if
(
!
oldWxsWatches
)
{
oldWxsWatches
=
{};
}
var
wxsProps
=
vnode
.
data
.
wxsProps
;
vnode
.
$wxsWatches
=
{};
Object
.
keys
(
wxsProps
).
forEach
(
function
(
prop
)
{
var
watchProp
=
wxsProps
[
prop
];
vnode
.
$wxsWatches
[
prop
]
=
oldWxsWatches
[
prop
]
||
vnode
.
context
.
$watch
(
watchProp
,
function
()
{
this
.
$forceUpdate
();
},
{
deep
:
true
});
});
Object
.
keys
(
oldWxsWatches
).
forEach
(
function
(
oldName
)
{
if
(
!
vnode
.
$wxsWatches
[
oldName
])
{
oldWxsWatches
[
oldName
]();
delete
oldWxsWatches
[
oldName
];
}
});
}
var
wxs
=
{
create
:
updateWxsProps
,
update
:
updateWxsProps
};
function
parseDataset
(
attrs
)
{
var
dataset
=
Object
.
create
(
null
);
Object
.
keys
(
attrs
).
forEach
(
function
(
name
)
{
...
...
@@ -6765,6 +6812,7 @@ var events = {
};
var
platformModules
=
[
wxs
,
attrs
,
events
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录