Vue.js Window Print


We can use window print method to print the current window page. Here in this tutorial, we are going to explain how you can use JavaScript Window Print method.


Vue.js Window Print Method Example

We can use window.print() method to print the current window in vue.js-

Example:

<div id="app">
	<button @click="printWindow()">Print</button>
</div>
<script>
 new Vue({
 el: '#app',
  
  data: {
  },  
   methods:{
    printWindow: function () {		
	 window.print();
    }
	}

});
</script>  

Try it »

Output of above example-


Advertisements

Add Comment

📖 Read More