cordova plugin add cordova-plugin-app-version
<template>
<div id="app">
<button @click="getVersionApp">앱버전?</button>
<div class="dump" v-if="cordova">
<div>cordova.deviceready : {{ cordova.deviceready }}</div>
<div>version : {{ version }}</div>
</div>
</div>
</template>
<script>
import Vue from 'vue';
export default {
methods: {
pluginEnabled() {
console.log(this.cordova.plugins);
},
getVersionApp() {
var self = this;
window.cordova.getAppVersion.getVersionNumber(function (version) {
alert(version);
self.version = version;
});
},
},
data() {
return {
cordova: Vue.cordova,
version: '',
};
},
};
</script>