ant-design-vue/components/_util/store/Provider.jsx

16 lines
314 B
Vue
Raw Normal View History

2020-06-16 14:55:02 +00:00
import { provide } from 'vue';
2019-01-12 03:33:27 +00:00
import { storeShape } from './PropTypes';
2020-06-16 14:55:02 +00:00
import { getSlot } from '../props-util';
2018-03-25 10:07:04 +00:00
export default {
name: 'StoreProvider',
props: {
store: storeShape.isRequired,
},
2020-06-16 14:55:02 +00:00
created() {
provide('storeContext', this.$props);
2018-03-25 10:07:04 +00:00
},
2019-01-12 03:33:27 +00:00
render() {
2020-06-16 14:55:02 +00:00
return getSlot(this);
2018-03-25 10:07:04 +00:00
},
2019-01-12 03:33:27 +00:00
};