ant-design-vue/components/vc-menu/FunctionProvider.jsx
2020-11-26 23:43:22 +08:00

21 lines
504 B
Vue

// import PropTypes from '../_util/vue-types';
import { computed, provide } from 'vue';
import { propTypes } from '../vc-progress/src/types';
export const injectExtraPropsKey = Symbol();
const FunctionProvider = {
inheritAttrs: false,
isMenuProvider: true,
props: {
extraProps: propTypes.object,
},
setup(props, { slots }) {
provide(
injectExtraPropsKey,
computed(() => props.extraProps),
);
return () => slots.default?.();
},
};
export default FunctionProvider;