index.js 871 B

1234567891011121314151617181920212223242526272829
  1. import _extends from "@babel/runtime/helpers/esm/extends";
  2. import { createNamespace } from '../utils';
  3. import TimePicker from './TimePicker';
  4. import DatePicker from './DatePicker';
  5. var _createNamespace = createNamespace('datetime-picker'),
  6. createComponent = _createNamespace[0],
  7. bem = _createNamespace[1];
  8. export default createComponent({
  9. props: _extends({}, TimePicker.props, DatePicker.props),
  10. methods: {
  11. // @exposed-api
  12. getPicker: function getPicker() {
  13. return this.$refs.root.getProxiedPicker();
  14. }
  15. },
  16. render: function render() {
  17. var h = arguments[0];
  18. var Component = this.type === 'time' ? TimePicker : DatePicker;
  19. return h(Component, {
  20. "ref": "root",
  21. "class": bem(),
  22. "scopedSlots": this.$scopedSlots,
  23. "props": _extends({}, this.$props),
  24. "on": _extends({}, this.$listeners)
  25. });
  26. }
  27. });