mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
35 lines
663 B
JavaScript
35 lines
663 B
JavaScript
import { createNamespace } from '../utils';
|
|
import TimePicker from './TimePicker';
|
|
import DatePicker from './DatePicker';
|
|
|
|
const [createComponent, bem] = createNamespace('datetime-picker');
|
|
|
|
export default createComponent({
|
|
props: {
|
|
...TimePicker.props,
|
|
...DatePicker.props,
|
|
},
|
|
|
|
methods: {
|
|
// @exposed-api
|
|
getPicker() {
|
|
return this.$refs.root.getPicker();
|
|
},
|
|
},
|
|
|
|
render() {
|
|
const Component = this.type === 'time' ? TimePicker : DatePicker;
|
|
|
|
return (
|
|
<Component
|
|
ref="root"
|
|
class={bem()}
|
|
{...{
|
|
props: this.$props,
|
|
on: this.$listeners,
|
|
}}
|
|
/>
|
|
);
|
|
},
|
|
});
|