Authored by 郭成尧

app调用H5

... ... @@ -249,7 +249,9 @@ const yoho = {
* @param callback 回调
*/
addNativeMethod(name, callback) {
window.yohoInterface[name] = callback;
if (window.yohoInterface) {
window.yohoInterface[name] = callback;
}
}
};
... ...
... ... @@ -29,6 +29,14 @@
return {
yoho
};
},
created() {
yoho.addNativeMethod('headerRightTopBtn', function(data) {
alert('app 调用 H5 成功!');
if (data) {
alert('传递的信息是:' + data);
}
});
}
};
</script>
... ...