Vuejs Nested Templates and Components using Nested Router

Rate this post

Vuejs Nested Templates and Components using Nested Router

In this Post We Will Explain About is Vuejs Nested Templates and Components using Nested Router With Example and Demo.

Welcome on infinityknow.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to javascript – Vuejs nested components, templates, and using Modals

In this post we will show you Best way to implement javascript – VueJS nested components, hear for How to javascript – Vuejs nested components with inline-template with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

READ :  convert generic list to datatable in Asp.Net C#,VB

Vuejs Example : index.html

First of all you create a multiple template or multiple Components using vuejs ad the also CSS Applay this both two way data bindnig and template.

[php]

{{name}}

student 1
student 2

[/php]

index.js

here learn to vuejs router to all template dynemic data show and hide using vuejs templates.

[php]
var router = new VueRouter()

var App = Vue.extend({})

var student = {
‘1’: {
name: ‘student 1’,
dirty: false
},
‘2’: {
name: ‘student 2’,
dirty: false
}
}

var studentComponent = Vue.extend({
template: ‘#student-template’,
data: {
name: “A student”,
dirty: false
},
methods: {
nameChanged: function() {
this.dirty = true;
},
save: function() {
this.dirty = false;
}
},
route: {
data: function(transition) {
return student[transition.to.params.id];
},
canReuse: false,
activate: function(transition) {
console.log(‘activate’, this.name)
transition.next()
},
canDeactivate: function () {
if (this.dirty) {
alert(‘simple Changes not saved for infinityknow.com’)
return false;
}
}
}
});

READ :  AngularJS Material Introduction and Hello World example

var StudComponent = Vue.extend({
template: ‘#student-template’
});

router.map({
‘/student’: {
component: StudComponent,
subRoutes: {
‘/:id’: {
component: studentComponent

}
}
}
})

router.start(App, ‘body’)
[/php]

Example

I hope you have Got javascript – Vuejs nested components, templates, and using Modals And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

Leave a Reply

Your email address will not be published.