ll-package
Version:
2 lines (1 loc) • 1.77 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../../hooks/useDesign.js");require("../../../../node_modules/ant-design-vue/es/form/index.js");const C=require("../../../../node_modules/ant-design-vue/es/form/Form.js"),v=require("../../../../node_modules/ant-design-vue/es/input-number/index.js"),x=a=>(e.pushScopeId("data-v-2a3e325d"),a=a(),e.popScopeId(),a),I=x(()=>e.createElementVNode("span",{class:"separator"},"-",-1)),b=e.defineComponent({name:"LlNumberRange"}),q=e.defineComponent({...b,props:{value:Array,precision:Number},emits:["update:value","change"],setup(a,{emit:p}){const u=a,r=p,m=e.useAttrs(),t=e.ref(void 0),o=e.ref(void 0),{prefixCls:f}=_.useDesign("number-range"),i=C.default.useInjectFormItemContext(),g=e.computed(()=>({...e.unref(m)})),c=e.computed(()=>u.precision||u.precision===0?u.precision:void 0),h=n=>{Array.isArray(n)&&n.length===2?(t.value=n[0],o.value=n[1]):(t.value=void 0,o.value=void 0)};e.watch(()=>u.value,n=>{h(n)},{immediate:!0});const d=()=>{if(!t.value&&t.value!==0&&!o.value&&o.value!==0){r("update:value",[]),r("change",[]),i.onFieldChange();return}r("update:value",[t.value,o.value]),r("change",[t.value,o.value]),i.onFieldChange()};return(n,l)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(f)},g.value),[e.createVNode(e.unref(v.default),{value:t.value,"onUpdate:value":l[0]||(l[0]=s=>t.value=s),placeholder:"最小值",precision:c.value,controls:!1,onChange:d},null,8,["value","precision"]),I,e.createVNode(e.unref(v.default),{value:o.value,"onUpdate:value":l[1]||(l[1]=s=>o.value=s),placeholder:"最大值",precision:c.value,controls:!1,onChange:d},null,8,["value","precision"])],16))}});exports.default=q;
;