kudago / smart-app-banner

Lightweight smart app banner with no jquery requirement
MIT License
526 stars 250 forks source link

How to use it with Vue js? #104

Open Lak0sta opened 6 years ago

Lak0sta commented 6 years ago

Please tell where I need to implement this global object with Smartbanner and does it support deep linking?

LouisMazel commented 5 years ago

Like that :

In your main.js/app.js

import SmartBanner from 'smart-app-banner'
import 'smart-app-banner/dist/smart-app-banner.css'

new Vue({
  el: '#app',
  template: '<App/>',
  components: { App },
  created () {
    new SmartBanner({
      daysHidden: 15,   // days to hide banner after close button is clicked (defaults to 15)
      daysReminder: 90, // days to hide banner after "VIEW" button is clicked (defaults to 90)
      title: 'Your title',
      author: 'Author',
      button: 'VIEW',
      store: {
        ios: 'On the App Store',
        android: 'In Google Play',
        windows: 'In Windows store'
      },
      price: {
        ios: 'FREE',
        android: 'FREE',
        windows: 'FREE'
      }
      // , theme: '' // put platform type ('ios', 'android', etc.) here to force single theme on all device
      // , icon: '' // full path to icon image if not using website icon image
    })
  }
}).$mount('#app')