test Vuejs
HTML
<html>
<head>
<title>VueJs Instance</title>
<link href = "https://cdn.jsdelivr.net/npm/[email protected]" rel = "stylesheet" type = "text/css">
<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>
<script type = "text/javascript" src = "https://cdn.jsdelivr.net/vue/latest/vue-router.js"></script>
</head>
<script type = "text/javascript">
var _obj = { fname: "Raj", lname: "Singh"};
// direct instance creation
var vm = new Vue({
data: _obj
});
console.log(vm.fname);
console.log(vm.$data);
console.log(vm.$data.fname);
// must use function when in Vue.extend()
var Component = Vue.extend({
data: function () {
return _obj
}
});
var myComponentInstance = new Component();
console.log(myComponentInstance.lname);
console.log(myComponentInstance.$data);
</script>
</html>