All Projects → shilx → Vue-JsBridge

shilx / Vue-JsBridge

Licence: other
JsBridge for Vue

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Vue-JsBridge

Jspatch
JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
Stars: ✭ 11,337 (+75480%)
Mutual labels:  jsbridge
Dsbridge Ios
🌏 A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.
Stars: ✭ 1,673 (+11053.33%)
Mutual labels:  jsbridge
Dsbridge Android
🌎 A modern cross-platform JavaScript bridge, through which you can invoke each other's functions synchronously or asynchronously between JavaScript and native.
Stars: ✭ 3,239 (+21493.33%)
Mutual labels:  jsbridge
JSBridge
JSBridge与Native通信,对Web端调用进行封装
Stars: ✭ 19 (+26.67%)
Mutual labels:  jsbridge
animaris
Documentation and Mock for JSBridge base on ThinkJS & MongoDB & React & Antd.
Stars: ✭ 28 (+86.67%)
Mutual labels:  jsbridge
ZJsBridge
一套完整的native-bridge-web协议与实现,清晰规范的开发Hybrid App
Stars: ✭ 21 (+40%)
Mutual labels:  jsbridge
autojs-webView
autojs的webView实现,支持初始化脚本注入、jsBridge两端互调
Stars: ✭ 38 (+153.33%)
Mutual labels:  jsbridge
QuickWebKit
A great & strong plugin based WebViewController. 一款基于插件的 WebView 视图控制器,您可以基于它设计您的浏览器插件,然后像积木一样来组装它们。
Stars: ✭ 29 (+93.33%)
Mutual labels:  jsbridge
AppHostExample
a web-based project embeded AppHost
Stars: ✭ 16 (+6.67%)
Mutual labels:  jsbridge
SwiftJSBridge
SwiftJSBridge is a handy JavaScript Bridge, written in Swift, support WKWebView and UIWebView
Stars: ✭ 29 (+93.33%)
Mutual labels:  jsbridge
WKBridge
Bridge for WKWebView and JavaScript
Stars: ✭ 70 (+366.67%)
Mutual labels:  jsbridge
vue-js-bridge
vue-js-bridge for Vue.js
Stars: ✭ 41 (+173.33%)
Mutual labels:  jsbridge
FMWebViewJavascriptBridge
FMWebViewJavascriptBridge inspired by WebViewJavascripBridge and react native
Stars: ✭ 29 (+93.33%)
Mutual labels:  jsbridge
JsBridge-WebViewJavascriptBridge-Sample
iOS JsBridge Solution by WebViewJavascriptBridge
Stars: ✭ 16 (+6.67%)
Mutual labels:  jsbridge

Vue-JsBridge

JsBridge for Vue

android 4.0+ , ios8.0+ 测试通过

引入

main.js:

import JsBridge from './你的路径/jsBridge'
Vue.use(JsBridge)

使用

component.vue:

...
mounted() {
    this.JsBridge.registerHandler(
        'testJs',//注册的方法名,供原生调用
        (data, responseCallback) => {
        data = JSON.stringify(data)//收到原生发来的数据
        ...
        responseCallback("js say: got it!")//处理完成后返回给原生
    })
},
methods:{
    showToast(){
        this.JsBridge.callHandler(
            'toast',//原生声明的函数名称
            { data: `处理成功` },//发送给原生的数据
            (res) => {
                res = JSON.parse(res)//原生处理完成后返回的数据
                ...
            }
        )
    }
}
...

其他

  • 更多 Obj-CJavaScript 交互请参阅 WebViewJavascriptBridge
  • 真机调试可以使用 android 系统设备连接电脑打开 chrome 的 chrome://inspect/#devices 进行调试
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].