vant/packages/utils/use/index.js
2019-02-02 10:41:01 +08:00

18 lines
385 B
JavaScript

import useBem from './bem';
import useSfc from './sfc';
import useI18n from './i18n';
export function use(name) {
name = 'van-' + name;
return [useSfc(name), useBem(name), useI18n(name)];
}
export function useSlots({ $slots, $scopedSlots }) {
return (name, props) => {
if ($scopedSlots[name]) {
return $scopedSlots[name](props);
}
return $slots[name];
};
}