vue-wonderpush
This service lets you integrate Wonderpush in your Vue applications easily.
Features
Installation and Quick Start
1- Installation:
You can install the module from a package manager of your choice directly from the command line
# Yarn yarn add vue-wonderpush # NPM npm i vue-wonderpush
2- In your application
;WonderPush;
Options available for wonderpush.init: https://wonderpush.github.io/wonderpush-javascript-sdk/latest/WonderPush.html#.InitOptions
3- In your components
Integrate a wonderpush subscription:
<template> <div className="switch-container"> <div id="wonderpush-subscription-switch" data-on="YES" data-off="NO"></div> </div></template> <script> name: 'SwitchButton' </script>
Create a component who need wonderpush:
;<template> <div v-bind:class= "['event', 'myEvent']" v-on:click="fireEvent()" > Click this div to track "myEvent" </div></template> <script> props: "wonderPush" methods: { this$propswonderPush } </script>
Give the wonderpush object on the import:
<template> <EventToTrack/></template> <script> name : 'ParentOfEventToTrack' components: EventToTrack: </script>
WithWonderPush take two arguments:
- Component
- options
Options available:
- waitWonderPushReady: boolean (default : false)
Sample app
To help you with your implementaiton we provided a sample application. to run it
cd wonderpush-sample-appyarn start
then go to http://localhost:8080
License
This module is released under the permissive MIT License. Your contributions are always welcome.
Development
Start the wonderpush-sample-app with npm start or yarn start will install and build library and install sample-app node_modules if they not exists.
After forking you will need to run the following from a command line to get your environment setup:
yarn install
After install you have the following commands available to you from a command line:
gulp