packages/okam-core/src/extend/ref/ant/index.js
function initRefs() {
    this.$refs = {};

    let refInfo = this.props && this.props[REF_DATA_ATTR];
    let pageInstance = this.$page || this;
    let refComponents = pageInstance.__refComponents /* istanbul ignore next */ || {};
    pageInstance.__refComponents = refComponents;

    if (refInfo) {
        if (refInfo.charAt(0) === '[') {
            refComponents[refInfo] /* istanbul ignore next */ || (refComponents[refInfo] = []);
            refComponents[refInfo].push(this);
        }
        else {
            refComponents[refInfo] = this;
        }
    }

    let refs = this.$rawRefData;
    if (typeof refs === 'function') {
        refs = refs();
    }

    if (!refs) {
        return;
    }

    let result = {};
    Object.keys(refs).forEach(id => {
        result[id] = {
            get() {
                let value = refs[id];
                let isSelectAll = Array.isArray(value);
                isSelectAll && (value = value[0]);
                let key = isSelectAll ? `[]${value}` : value;
                let result = refComponents[key];
                isSelectAll && !result && (result = []);
                return result;
            },
            enumerable: true
        };
    });

    Object.defineProperties(this.$refs, result);
}
function initRefs() {
    this.$refs = {};

    let refInfo = this.props && this.props[REF_DATA_ATTR];
    let pageInstance = this.$page || this;
    let refComponents = pageInstance.__refComponents /* istanbul ignore next */ || {};
    pageInstance.__refComponents = refComponents;

    if (refInfo) {
        if (refInfo.charAt(0) === '[') {
            refComponents[refInfo] /* istanbul ignore next */ || (refComponents[refInfo] = []);
            refComponents[refInfo].push(this);
        }
        else {
            refComponents[refInfo] = this;
        }
    }

    let refs = this.$rawRefData;
    if (typeof refs === 'function') {
        refs = refs();
    }

    if (!refs) {
        return;
    }

    let result = {};
    Object.keys(refs).forEach(id => {
        result[id] = {
            get() {
                let value = refs[id];
                let isSelectAll = Array.isArray(value);
                isSelectAll && (value = value[0]);
                let key = isSelectAll ? `[]${value}` : value;
                let result = refComponents[key];
                isSelectAll && !result && (result = []);
                return result;
            },
            enumerable: true
        };
    });

    Object.defineProperties(this.$refs, result);
}
function initRefs ( ) { this . $refs = { } ; let refInfo = this . props && this . props [ REF_DATA_ATTR ] ; let pageInstance = this . $page || this ; let refComponents = pageInstance . __refComponents /* istanbul ignore next */ || { } ; pageInstance . __refComponents = refComponents ; if ( refInfo ) { if ( refInfo . charAt ( 0 ) === '[' ) { refComponents [ refInfo ] /* istanbul ignore next */ || ( refComponents [ refInfo ] = [ ] ) ; refComponents [ refInfo ] . push ( this ) ; } else { refComponents [ refInfo ] = this ; } } let refs = this . $rawRefData ; if ( typeof refs === 'function' ) { refs = refs ( ) ; } if ( ! refs ) { return ; } let result = { } ; Object . keys ( refs ) . forEach ( id => { result [ id ] = { get ( ) { let value = refs [ id ] ; let isSelectAll = Array . isArray ( value ) ; isSelectAll && ( value = value [ 0 ] ) ; let key = isSelectAll ? ` ${ value } ` : value ; let result = refComponents [ key ] ; isSelectAll && ! result && ( result = [ ] ) ; return result ; } , enumerable : true } ; } ) ; Object . defineProperties ( this . $refs , result ) ; }
Initialize the `$refs` value

@inner
Initialize the $refs value