提交 81699c7a 编写于 作者: fxy060608's avatar fxy060608

feat(v3): add uni-view-update

上级 f1743420
......@@ -59,6 +59,16 @@ const handleData = {
}
}
function broadcast (vm, componentName, eventName, ...params) {
vm.$children.forEach(child => {
const name = child.$options.name && child.$options.name.substr(1)
if (~componentName.indexOf(name)) {
child.$emit(eventName, ...params)
}
broadcast(child, componentName, eventName, ...params)
})
}
function vdSync ({
data,
options
......@@ -71,8 +81,13 @@ function vdSync ({
handleData[data[0]](data[1])
})
vd.flush()
isVdCallback && Vue.nextTick(() => {
UniViewJSBridge.publishHandler(VD_SYNC_CALLBACK)
Vue.nextTick(() => {
broadcast(
getCurrentPages()[0].$vm,
['Camera', 'LivePlayer', 'LivePusher', 'Map', 'Video'],
'uni-view-update'
)
isVdCallback && UniViewJSBridge.publishHandler(VD_SYNC_CALLBACK)
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册