Vue调用IOS原生方法

2018-09-13  本文已影响0人  渔夫的小黑屋
<template>
    <div id="share">
        <h1 style="text-align: center;">分享H5</h1>
        <el-button round @click="open">按钮</el-button>
    </div>
</template>
<script>
    export default {
        name: 'share',
        components: {},
        data() {
            return {}
        },
        mounted: function () {
        },
        methods: {
            open() {
                tianbai.inviteShare('11', '22', '33', '44')
                 }
            }
        }
</script>
<style lang="scss">
</style>
self.context =[self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
self.context.exceptionHandler = ^(JSContext *context, JSValue *exceptionValue) {
        context.exception = exceptionValue;
        NSLog(@"异常信息:%@", exceptionValue);
};
self.context[@"tianbai"] = self


-(void)inviteShare:(NSString *)shareInfo :(NSString *)content :(NSString *)img :(NSString *)url{
}
上一篇 下一篇

猜你喜欢

热点阅读