import { Vue, Component, Prop } from 'vue-property-decorator';
import { IPSAppDEEditView } from '@ibizstudio-ex/runtime';
import { CreateElement } from 'vue';

/**
 * 设计届满容器组件
 *
 * @author chitanda
 * @date 2021-04-14 10:04:44
 * @export
 * @class DesignViewWrapper
 * @extends {Vue}
 */
@Component({})
export class DesignViewWrapper extends Vue {
    /**
     * 上下文
     *
     * @author chitanda
     * @date 2021-04-14 10:04:42
     * @type {*}
     */
    @Prop()
    context: any;

    /**
     * 请求参数
     *
     * @author chitanda
     * @date 2021-04-14 10:04:12
     * @type {*}
     */
    @Prop()
    params: any;

    /**
     * 视图模型
     *
     * @author chitanda
     * @date 2021-04-14 10:04:47
     * @type {IPSAppDEEditView}
     */
    @Prop()
    viewModel!: IPSAppDEEditView;

    render(h: CreateElement): any {
        return h(this.viewModel.codeName, {
            props: {
                context: this.context,
                params: this.params,
                viewModel: this.viewModel,
            },
        });
    }
}
