wux-weapp
Version:
一套组件化、可复用、易扩展的微信小程序 UI 组件库
24 lines (21 loc) • 618 B
JavaScript
import baseComponent from '../helpers/baseComponent'
import popupMixin from '../helpers/popupMixin'
import { props } from '../date-picker-view/props'
import { formatDate } from './utils'
const platformProps = {
labelPropName: 'label',
format(values, props) {
const o = {
datetime: 'yyyy-MM-dd hh:mm',
date: 'yyyy-MM-dd',
year: 'yyyy',
month: 'MM-dd',
time: 'hh:mm',
}
return formatDate(values.date, o[props.mode])
},
}
baseComponent({
behaviors: [popupMixin('#wux-picker', platformProps)],
properties: props,
})