[vue-cordova] cordova-plugin-app-version [ 앱 버전 확인 ]

suhanLee·2022년 7월 12일
0

cordova

목록 보기
10/16
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>

0개의 댓글