tk-eui-plus
Version:
2 lines (1 loc) • 2.08 kB
JavaScript
(function(e,l){typeof exports=="object"&&typeof module<"u"?module.exports=l(require("vue")):typeof define=="function"&&define.amd?define(["vue"],l):(e=typeof globalThis<"u"?globalThis:e||self,e.index=l(e.Vue))})(this,function(e){"use strict";const l={style:{display:"flex"}},p={style:{"margin-right":"20px"}},c=((t,o)=>{const a=t.__vccOpts||t;for(const[d,i]of o)a[d]=i;return a})(e.defineComponent({__name:"index",props:{startPlaceholder:{type:String,default:"请选择开始时间"},startTimeStart:{type:String,default:"08:00"},startTimeStep:{type:String,default:"00:30"},startTimeEnd:{type:String,default:"24:00"},endPlaceholder:{type:String,default:"请选择结束时间"},endTimeStart:{type:String,default:"08:00"},endTimeStep:{type:String,default:"00:30"},endTimeEnd:{type:String,default:"24:00"}},emits:["startChange","endChange"],setup(t,{emit:o}){let a=o,d=e.ref(""),i=e.ref(""),m=e.ref(!0);return e.watch(()=>d.value,n=>{!n||n===""?(i.value="",m.value=!0):(m.value=!1,a("startChange",n))}),e.watch(()=>i.value,n=>{(!n||n!=="")&&a("endChange",{startTime:d.value||"",endTime:n||""})}),(n,s)=>{const f=e.resolveComponent("el-time-select");return e.openBlock(),e.createElementBlock("div",l,[e.createElementVNode("div",p,[e.createVNode(f,e.mergeProps({modelValue:e.unref(d),"onUpdate:modelValue":s[0]||(s[0]=r=>e.isRef(d)?d.value=r:d=r),style:{"min-width":"170px"},"max-time":e.unref(i),placeholder:t.startPlaceholder,start:t.startTimeStart,step:t.startTimeStep,end:t.startTimeEnd},n.$attrs.startOptions),null,16,["modelValue","max-time","placeholder","start","step","end"])]),e.createElementVNode("div",null,[e.createVNode(f,e.mergeProps({style:{"min-width":"170px"},modelValue:e.unref(i),"onUpdate:modelValue":s[1]||(s[1]=r=>e.isRef(i)?i.value=r:i=r),"min-time":e.unref(d),placeholder:t.endPlaceholder,start:t.endTimeStart,step:t.endTimeStep,end:t.endTimeEnd,disabled:e.unref(m)},n.$attrs.endOptions),null,16,["modelValue","min-time","placeholder","start","step","end","disabled"])])])}}}),[["__scopeId","data-v-e534e694"]]);return{install(t){t.component("tkChooseTime",c)}}});