Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
2016-07-26 14:43:18 +0800
Commit
02516f9f9676fa8d45375566b9a8bf6ea4826a0a
1 parent
7e1edc1f
app调用H5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
public/js/yoho.js
public/vue/example/app-box.vue
public/js/yoho.js
View file @
02516f9
...
...
@@ -249,7 +249,9 @@ const yoho = {
* @param callback 回调
*/
addNativeMethod
(
name
,
callback
)
{
window
.
yohoInterface
[
name
]
=
callback
;
if
(
window
.
yohoInterface
)
{
window
.
yohoInterface
[
name
]
=
callback
;
}
}
};
...
...
public/vue/example/app-box.vue
View file @
02516f9
...
...
@@ -29,6 +29,14 @@
return {
yoho
};
},
created() {
yoho.addNativeMethod('headerRightTopBtn', function(data) {
alert('app 调用 H5 成功!');
if (data) {
alert('传递的信息是:' + data);
}
});
}
};
</script>
...
...
Please
register
or
login
to post a comment