import{_ as i}from"./uv-tabs.Dgbny3zs.js";import{_ as o,c as l,w as u,j as d,C as _,E as m,o as b,k as h,aZ as p}from"./index-CZJgrp0v.js";const f={name:"FlatTab",props:{tabList:{type:Array,default:()=>[]},scrollable:{type:Boolean,default:!1},initTab:{type:String,default:""}},data(){return{curIndex:0}},computed:{scrollableComputed(){return!!(this.scrollable||this.tabList.length>4)}},watch:{initTab:{handler(e,n){e&&e!=n&&(this.curIndex=this.tabList.findIndex(t=>t.key===e),console.log({curIndex:this.curIndex,val:e}),this.$emit("clickTab",{key:e}))},immediate:!0}},methods:{clickTab(e){e.index!==this.curIndex&&(this.curIndex=e.index,this.$emit("clickTab",e))},changeTab(e){this.$emit("changeTab",e)}},mounted(){}};function x(e,n,t,C,c,a){const r=_(m("uv-tabs"),i),s=d;return b(),l(s,{class:"tabs-container"},{default:u(()=>[h(r,p({list:t.tabList,lineWidth:"50",lineColor:"#0067C0",activeStyle:{color:"#0067C0"},inactiveStyle:{color:"#5B7B96"},scrollable:a.scrollableComputed,current:c.curIndex,onClick:a.clickTab,onChange:a.changeTab},e.$attrs),null,16,["list","scrollable","current","onClick","onChange"])]),_:1})}const y=o(f,[["render",x],["__scopeId","data-v-a4ade532"]]);export{y as _};
