import { MDViewController } from '@ibiz-template/controller'; import { defineComponent, PropType } from 'vue'; export const MDViewBase = defineComponent({ props: { controller: { type: Object as PropType, required: true, }, }, setup() { return {}; }, render() { const c = this.controller; // 外面的插槽同样传给view-layout const inheritSlots: IData = {}; Object.keys(this.$scopedSlots).forEach(key => { inheritSlots[key] = (arg: IData) => this.$scopedSlots[key]!(arg); }); return ( { if (c.complete && c.model.source.enableQuickSearch) { return ( { c.query = val; }} on-search={() => c.onSearch()} > ); } }, searchForm: () => { if (c.complete && c.model.searchForm) { return ( ); } }, ...inheritSlots, }} /> ); }, });