vant/src/action-bar/ActionBar.tsx
neverland bd609e1df0
perf: add truthProp util (#8522)
* perf: add TruthyProp util

* chore: rename

* chore: upd
2021-04-14 10:26:21 +08:00

28 lines
575 B
TypeScript

import { defineComponent } from 'vue';
import { truthProp, createNamespace } from '../utils';
import { useChildren } from '@vant/use';
const [name, bem] = createNamespace('action-bar');
export const ACTION_BAR_KEY = Symbol(name);
export default defineComponent({
name,
props: {
safeAreaInsetBottom: truthProp,
},
setup(props, { slots }) {
const { linkChildren } = useChildren(ACTION_BAR_KEY);
linkChildren();
return () => (
<div class={bem({ unfit: !props.safeAreaInsetBottom })}>
{slots.default?.()}
</div>
);
},
});