November 2017
Beginner to intermediate
398 pages
8h 42m
English
We can configure the plugin with an options parameter:
export default { install (Vue, options) { console.log('Installed!', options) }, }
We can now add a configuration object to the Vue.use() method in the main.js file.
Vue.use(VueFetch, { baseUrl: 'http://localhost:3000/', })
You should now see the options object in the browser console.
let baseUrl export default { install (Vue, options) { console.log('Installed!', options) baseUrl = options.baseUrl }, }
Read now
Unlock full access