initLang(app) {
        let langObj = this.getLangCode();

        // 阿拉伯语阅读习惯是从右到左
        if (this.options.rtlList.indexOf(langObj.lang) != -1) {
            document.documentElement.setAttribute('dir', 'rtl');
        }

        this.add(this.options.callback);

        app._langUtil = {
            langCode: langObj.lang,
            countryCode: langObj.countryCode,
            onReady: fn => this.onReady(fn),
            template: (key, arr) => this.template(key, arr)
        };
        for (let i in app._langUtil) {
            this.setLangCache(i, app._langUtil[i]);
        }
        // 因为langObj保存着ajax回调数据 会异步 采用双向数据监听方式
        Object.defineProperty(app._langUtil, 'langObj', {
            configurable: true,
            get: () => {
                return this.settings['langObj'];
            },
            set: value => {
                this.settings['langObj'] = value;
            }
        });

        this.getFiles(this.options.path + '/' + langObj.lang + '.json?v=' + this.options.version);
    }
/**
     * @param app - Vue component instance
     */
@param app - Vue component instance
@param app - Vue component instance
initLang(app) {
        let langObj = this.getLangCode();
        if (this.options.rtlList.indexOf(langObj.lang) != -1) {
            document.documentElement.setAttribute('dir', 'rtl');
        }
        this.add(this.options.callback);
        app._langUtil = {
            langCode: langObj.lang,
            countryCode: langObj.countryCode,
            onReady: fn => this.onReady(fn),
            template: (key, arr) => this.template(key, arr)
        };
        for (let i in app._langUtil) {
            this.setLangCache(i, app._langUtil[i]);
        }
        Object.defineProperty(app._langUtil, 'langObj', {
            configurable: true,
            get: () => {
                return this.settings['langObj'];
            },
            set: value => {
                this.settings['langObj'] = value;
            }
        });
        this.getFiles(this.options.path + '/' + langObj.lang + '.json?v=' + this.options.version);
    }
initLang ( app ) { let langObj = this . getLangCode ( ) ; if ( this . options . rtlList . indexOf ( langObj . lang ) != - 1 ) { document . documentElement . setAttribute ( 'dir' , 'rtl' ) ; } this . add ( this . options . callback ) ; app . _langUtil = { langCode : langObj . lang , countryCode : langObj . countryCode , onReady : fn => this . onReady ( fn ) , template : ( key , arr ) => this . template ( key , arr ) } ; for ( let i in app . _langUtil ) { this . setLangCache ( i , app . _langUtil [ i ] ) ; } Object . defineProperty ( app . _langUtil , 'langObj' , { configurable : true , get : ( ) => { return this . settings [ 'langObj' ] ; } , set : value => { this . settings [ 'langObj' ] = value ; } } ) ; this . getFiles ( this . options . path + '/' + langObj . lang + '.json?v=' + this . options . version ) ; }
@param app - Vue component instance
@param app - Vue component instance
// 阿拉伯语阅读习惯是从右到左 // 因为langObj保存着ajax回调数据 会异步 采用双向数据监听方式