Socket
Socket
Sign inDemoInstall

vue-bridge-webview

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-bridge-webview

javascript bridge android/ios webview


Version published
Weekly downloads
7
increased by75%
Maintainers
1
Install size
8.27 kB
Created
Weekly downloads
 

Readme

Source

vue-bridge-webview

javascript bridge android/ios webview

Installation

Browser

  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <script src="https://unpkg.com/vue-bridge-webview@1.1.0/vue-bridge-webview.js"></script>

Package Managers

npm install vue-bridge-webview --save

import Vue from 'vue'
import VueBridgeWebview from 'vue-bridge-webview'
Vue.use(VueBridgeWebview)

// set default config 
VueBridgeWebview.config(0,true);

Api

syntax format: [this | Vue | window].$bridge.[method]

  • Set global config
$bridge.config(handleDelayTime,silent); // default handleDelayTime = 0 * 1000,silent = false 
  • Android/IOS invoke JS
$bridge.registerHandler : function(name, registerCallback) // callback name, callback function

example: refersh page view
[this|Vue|window].$bridge.registerHandler("refreshPage",function(){
                              document.location.reload();
                          })
  • JS invoke Android/IOS
$bridge.callHandler: function(name,params,callback) // callback name, request params, callback function

example: get userInfo
[this|Vue|window].$bridge.callHandler('getUserInfo',{},function(data){
           ... 
        })

License

MIT Copyright (c) 2016-present, cmp-cc

Keywords

FAQs

Last updated on 12 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc