标签: stapes.js

与Stapes.js的继承

我正在尝试使用JS框架Stapes.js建立父/子链接.

这是我的代码:

var Parent = Stapes.subclass({
    constructor: function () {
        this.name = 'syl';
    }
});

var Child = Parent.subclass({
    constructor: function (value) {
        this.value = value;

        console.log(this.name); // undefined
    }
});

var child = new Child('a value');
Run Code Online (Sandbox Code Playgroud)

小提琴这里.

如何从子类访问父级的name属性?

javascript inheritance stapes.js

2
推荐指数
1
解决办法
547
查看次数

标签 统计

inheritance ×1

javascript ×1

stapes.js ×1