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

Mounting template in vue js

<?php 
require_once('../header.php');
?>
	<div id="app" class="text-center">
		<h2 > {{ title }}</h2>
	</div>
	<div id="app2" class="text-center">
		
	</div>

<?php 
require_once('../footer.php');
?>

<script type="text/javascript">
	var vm1 = new Vue({
		data: {
			title : "Vue Instance"
		}
	});
	vm1.$mount("#app");

	var vm2 = new Vue({
		template : "<h2> Hi Vue template</h2>"
	});
	vm2.$mount("#app2");
</script>

Demo http://vue.toihid.com/section-5/vue-mounting-template.php

You may also like...

Leave a Reply

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