nativescript-webview-interface icon indicating copy to clipboard operation
nativescript-webview-interface copied to clipboard

[Doc] Vue.js integration

Open vratojr opened this issue 6 years ago • 0 comments
trafficstars

For nativescript-vue do:

In your template:

<Page @load="onLoad">
....
<WebView ref="webView"/>
....
</Page>

in

import { WebView } from 'tns-core-modules/ui/web-view'
let webViewInterfaceModule = require('nativescript-webview-interface');

export default {
  data() {
      oWebViewInterface: null
    }
  },
  methods: {
    onLoad() {
      this.setupWebViewInterface();
    },
    setupWebViewInterface() {
      var webView = this.$refs.webView.nativeView;
      this.oWebViewInterface = new 
      webViewInterfaceModule.WebViewInterface(webView,'~/assets/www/treemap/index.html');
    }
  }
}

vratojr avatar Sep 03 '19 10:09 vratojr