drop-down-modal-4b54f8a5.js 978 B

1
  1. import{d,O as i,i as c,o as m,w as s,g as a,B as u,h as t,F as f}from"./index-e362c2e8.js";import{P as p}from"./index-14b5dea2.js";const D=d({name:"drop-down-modal",props:{selectValues:{type:[String,Number],default:null},columns:{type:Array,default:()=>[]},open:{type:Boolean,default:!1}},emits:["dropDownClose","dropDownConfirm"],setup(e,{emit:l}){const o=i({values:[]}),n=c();return m(()=>{o.values=[e.selectValues]}),s(()=>e.selectValues,()=>{o.values=[e.selectValues]}),s(()=>e.open,()=>{setTimeout(()=>{o.values=[e.selectValues]},100)}),()=>a(f,null,[a(p,{ref:n,modelValue:o.values,"onUpdate:modelValue":r=>o.values=r,showToolbar:!1,visibleOptionNum:5,columns:e.columns,onConfirm:()=>{l("dropDownConfirm",o.values)}},null),a("div",{class:["btnGroupPopup","van-hairline--top"]},[a(u,{round:!0,onClick:()=>l("dropDownClose")},{default:()=>[t("取消")]}),a(u,{type:"primary",round:!0,onClick:async()=>{await n.value.confirm()}},{default:()=>[t("确定")]})])])}});export{D};