mirror of
https://github.com/youzan/vant.git
synced 2025-12-24 02:02:09 +08:00
[improvement] Functional components be just functions (#2735)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user