How to use
Add the NPM package to your project
npm install --save vue-cordova-device
Add the plugin to your Vue instance according to your setup
// CommonJSvar Vue = ;var VueCordovaDevice = ;Vue;// importVue
Access the device information through the global Vue object
Vue.cordova object is created on top of the
Vue.cordova.device object that you are looking for. This may be used by other Vue Cordova plugins or by the Vue Cordova Suite.
Note : Install the Cordova Device plugin prior to build your Cordova app, obviously.
cordova plugin add cordova-plugin-device
Vue.cordova.device contains only
This information is not available until Cordova has triggered the
deviceready event. So the data would not be available immediately. More information about that on the Cordova Device plugin page.
Otherwise, the Cordova plugin might not be installed. Run
cordova plugin add cordova-plugin-device and try again.