[improvement] Functional components be just functions (#2735)

This commit is contained in:
neverland
2019-02-14 11:56:02 +08:00
committed by GitHub
parent 166397dad4
commit 5a9143c736
21 changed files with 704 additions and 674 deletions

View File

@@ -1,5 +1,4 @@
import { RenderContext, VNodeData } from 'vue/types';
import { ScopedSlot } from 'vue/types/vnode';
type ObjectIndex = {
[key: string]: any;
@@ -47,17 +46,3 @@ export function emit(context: Context, eventName: string, ...args: any[]) {
}
}
}
// unify slots & scopedSlots
export function unifySlots(context: Context) {
const { scopedSlots } = context;
const slots = context.slots();
Object.keys(slots).forEach(key => {
if (!scopedSlots[key]) {
scopedSlots[key] = () => slots[key];
}
});
return scopedSlots;
}