mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
[improvement] Tabbar: jsx (#2663)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
import use from './use';
|
||||
import { useSlots } from './slots';
|
||||
|
||||
const isServer = Vue.prototype.$isServer;
|
||||
|
||||
@@ -44,6 +45,7 @@ export {
|
||||
isObj,
|
||||
isDef,
|
||||
isServer,
|
||||
useSlots,
|
||||
camelize,
|
||||
isAndroid
|
||||
};
|
||||
|
8
packages/utils/slots.js
Normal file
8
packages/utils/slots.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export function useSlots({ $slots, $scopedSlots }) {
|
||||
return (name, props) => {
|
||||
if ($scopedSlots[name]) {
|
||||
return $scopedSlots[name](props);
|
||||
}
|
||||
return $slots[name];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user