Ext JS学习第七天 Ext自定义类,继承(二)

此文来记录学习笔记

一个简单ext继承的栗子

Ext.onReady(function () {
Ext.define('Person',{
    config:{
        name:'z3'
    } ,
    constructor:function(config){
        var me = this ;
        me.initConfig(config);
    }
    });
    //Sub Class
    Ext.define('Boy',{
    //使用Ext的继承
    extend:'Person',
        config:{
        sex:'男',
    age:20
    }
    });
    var b = Ext.create('Boy',{
        name:'张三',
        age:25
    });

})
    alert(b.name);
    alert(b.sex);
    alert(b.age);
})

给各位推荐个文章网www.fishcmonkey.com,学习之余提高文学修养

原文地址:https://www.cnblogs.com/lisr/p/3932071.html