mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
18 lines
385 B
JavaScript
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];
|
|
};
|
|
}
|