import { __decorate } from "tslib";
import { Component, Emit, Prop, Inject } from 'vue-property-decorator';
import { ViewContainerBase } from './view-container-base';
/**
 * 视图壳
 *
 * @export
 * @class AppIndexViewShell
 * @extends {ViewContainerBase}
 */
let AppIndexViewShell = class AppIndexViewShell extends ViewContainerBase {
    /**
     * 数据变化
     *
     * @param {*} val
     * @returns {*}
     * @memberof AppIndexViewShell
     */
    viewDatasChange(val) {
        return val;
    }
    /**
     * Vue声明周期
     *
     * @memberof AppIndexViewShell
     */
    created() {
        if (this.$route && this.$route.matched && this.$route.matched.length > 0) {
            let indexRoute = this.$route.matched.find((item) => {
                var _a;
                return (_a = item === null || item === void 0 ? void 0 : item.meta) === null || _a === void 0 ? void 0 : _a.dynaModelFilePath;
            });
            if (indexRoute) {
                this.dynaModelFilePath = indexRoute.meta.dynaModelFilePath;
            }
        }
        this.loadDynamicModelData();
    }
    /**
     * 视图绘制
     *
     * @memberof AppIndexViewShell
     */
    render(h) {
        if (!this.viewContainerName) {
            return;
        }
        return h(this.viewContainerName, {
            props: { dynamicProps: this.dynamicProps, staticProps: this.viewContext },
            on: {
                'view-event': this.handleViewEvent.bind(this),
            },
        });
    }
};
__decorate([
    Emit()
], AppIndexViewShell.prototype, "viewDatasChange", null);
__decorate([
    Prop()
], AppIndexViewShell.prototype, "staticProps", void 0);
__decorate([
    Prop()
], AppIndexViewShell.prototype, "dynamicProps", void 0);
__decorate([
    Inject({ from: 'navModel', default: 'tab' })
], AppIndexViewShell.prototype, "navModel", void 0);
AppIndexViewShell = __decorate([
    Component({})
], AppIndexViewShell);
export { AppIndexViewShell };
