Check out this simple shopping cart demo:
http://plnkr.co/edit/CHt2iNSRJAJ6OWs7xmiP?p=preview
A user can pick a veggie and a fruit, and it will be added into
If you are trying to share the same component logic between or along multiple vue template and layout, you can simply try this approach below:
before:
{{title}}
{{datetime}}
{{title}}
{{datetime}}
after:
{{title}}
{{datetime}}
{{title}}
{{datetime}}
export default {
props: {
title: String
},
data() {
return {
datetime: new Date()
}
}
}