@twoavy/vue-utils
v0.0.11
Published
Vue utils for easy interaction with the twoavy-api
Downloads
6
Keywords
Readme
@twoavy/vue-utils
Installation
yarn add @twoavy/vue-utils
Usage
import TwoavyUtils from '@twoavy/utils'
in main.js
Vue.use(TwoavyUtils, {
url: 'http://twoavy.test',
client_id: 13,
client_secret: 'b2834basdk8asd278dahb49urf39da',
logging: true,
device_id: 5,
showErrorsOnScreen: true, // directly handle errors and show them on-screen
ready: initVue, // callback when axios is ready to use
retries: 3 // number of axios retries before failing
})
// init Vue AFTER axios is set up
function initVue() {
new Vue({
store,
render: h => h(App)
}).$mount('#app')
in components
// make api calls
this.$axios.get('/dostuff')
// log events
this.$twoavy.log('log_type', 'log_message')