Skip to content

Instantly share code, notes, and snippets.



Last active Apr 18, 2019
What would you like to do?
Vue.js + ES6
<div id="demo">
<h1>{{bob.fields.firstName}} {{bob.fields.lastName}}</h1>
<ul id="humans-list">
<li v-repeat="humans">
{{fields.firstName}} {{fields.lastName}}
class Human {
constructor (arg={firstName:"John", lastName:"Doe"}) {
this.fields = arg;
get (fieldName) {
return this.fields[fieldName];
set (fieldName, value) {
this.fields[fieldName] = value;
return this;
class Demo extends Vue {
constructor () {
var properties = {
el: '#demo',
data: {
bob: new Human({firstName:"Bob", lastName:"Morane"})
class HumansList extends Vue {
constructor (collection) {
this.collection = collection;
el: "#humans-list", data: collection
let demo = new Demo()
let humansList = new HumansList({
new Human(),
new Human({firstName:"Jane", lastName:"Doe"})

This comment has been minimized.

Copy link

@hendrysadrak hendrysadrak commented Jun 3, 2016

Isn't "super()" supposed to be before "this"? File main.js, line 30-31.


This comment has been minimized.

Copy link

@rajsharma1612 rajsharma1612 commented May 25, 2017

@hendrysadrak yes you are right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.