Khandaker Toihidul Islam
Software Engineer
Backend : PHP | Mysql | Symfony | CakePhp | Wordpress | Drupal
Frontend : Node js | Vue js | React Js | Javascript | HTML | CSS | Bootstrap
Tools , Server : Nginx | Apache | Git | Jenkins | Jira | Asana | Silenium | Spira

Vue Disable re-rendering

We cane disable re-rendering by using v-once as bellow

	<div id="app">
		<h1 v-once> {{ title }} </h1>
		<p> {{ changeTitle() }} - <a v-bind:href="link"> Vue Tutorials</a></p>
	</div>
<script type="text/javascript">
	new Vue({
		el: "#app",
		data: {
			title : "Hello World",
			link : "http://vue.toihid.com/"
		},
		methods : {
			changeTitle: function(event){
				this.title = "Hi"
				return this.title;
			}
		}
	});
</script>

Demo http://vue.toihid.com/section-2/disable_re_rendering.php

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *