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 Shorthand

We can use @ for v-on and : for v-bind

	<div id="app">
		<button v-on:click="Count(1)">Increment by 1 </button>
		<p>Count : {{ count}}</p>
		<a v-bind:href="link">Link</a>
		<br/>
		<button @click="Count(1)">Increment by 1 </button>
		<p>Count : {{ count}}</p>
		<a :href="link">Link</a>
	</div>
<script type="text/javascript">
	new Vue({
		el: "#app",
		data: {
			count : 0,
			link : "http://vue.toihid.com/"
		},
		methods : {
			Count: function(step){
				this.count += step;
			}
		}

	});
</script>

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

You may also like...

Leave a Reply

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