[improvement] Tabbar: jsx (#2663)

This commit is contained in:
neverland
2019-02-01 17:10:31 +08:00
committed by GitHub
parent 5b3992d4c2
commit b8ec2ffc5d
6 changed files with 85 additions and 102 deletions

View File

@@ -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
View File

@@ -0,0 +1,8 @@
export function useSlots({ $slots, $scopedSlots }) {
return (name, props) => {
if ($scopedSlots[name]) {
return $scopedSlots[name](props);
}
return $slots[name];
};
}