Vue.js Get App Code Name Of Browser


We can use native JavaScript Navigator appCodename Property to get the App code name in Vue.js. Here in this tutorial, we are going to explain how you can get appCodeName in vue.js. You can also use our online editor to edit and run the code online.


Vue.js Get App Code Name Of Browser JavaScript

Here is an example of native JavaScript appCodeName property-

Example:

<div id="app">
	<p>Browser CodeName = {{result}}</p>
	<button @click="myFunction()">Click Me</button>
</div>
<script>
 new Vue({
 el: '#app',
  
  data: {
	  result: ''
  },  
   methods:{
    myFunction: function () {		
	 this.result = navigator.appCodeName;
    }
	}

});
</script>   

Try it »

If you run the above example it will produce the output something like this-

Vue.js Get App Code Name Of Browser


Advertisements

Add Comment

📖 Read More