tdesign-pro-component
Version:
ProComponents tdesign-vue-next + Vue3 + TS
76 lines (75 loc) • 1.88 kB
JavaScript
import "lodash-es";
import { g as n, w as b } from "./utils-CIySOLoe.js";
import { defineComponent as f, ref as P, watch as d, createVNode as m, mergeProps as g } from "vue";
import { FormItem as k, DateRangePicker as s } from "tdesign-vue-next";
const h = /* @__PURE__ */ f({
name: "ProFormDatePickerRange",
props: {
// about form
name: {
required: !0,
type: String
},
label: [String, Function, Object],
rules: Array,
formItemProps: Object,
// about input
modelValue: {
type: [Array],
default: () => []
},
placeholder: {
type: String,
default: "请选择日期"
},
readonly: Boolean,
borderless: Boolean,
disabled: Boolean,
enableTimePicker: Boolean,
clearable: Boolean,
format: {
type: String,
default: "YYYY-MM-DD"
},
datePickerLabel: [String, Function, Object],
prefixIcon: [Function, Object],
datePickerProps: Object
},
setup: (e, {
slots: l,
emit: t
}) => {
const o = n("label", l, e), c = n("datePickerLabel", l, e), i = n("prefixIcon", l, e), r = P(e.modelValue);
function u(a) {
t("change", a), r.value = a;
}
return d(() => e.modelValue, (a) => {
r.value = a;
}), d(r, (a) => {
t("update:modelValue", a);
}), () => m(k, g({
rules: e.rules,
name: e.name
}, e.formItemProps), {
default: () => m(s, {
range: !0,
value: r.value,
clearable: e.clearable,
borderless: e.borderless,
format: e.format,
onChange: u,
readonly: e.readonly,
disabled: e.disabled,
enableTimePicker: e.enableTimePicker,
placehoder: e.placeholder,
label: c() ? c() : null
}, {
prefixIcon: i() ? i() : null
}),
label: o() ? o : null
});
}
}), S = b(h);
export {
S as P
};