You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.8 KiB

5 days ago
  1. import{H as e,J as t,K as s,L as r,M as i,aO as o,O as a,X as n,o as l,c as g,w as d,d as h,P as u,R as c,e as p,t as _,m as y,i as P,j as f}from"./index-IX2tYR8R.js";import{_ as m}from"./_plugin-vue_export-helper.BCo6x5W8.js";const x=m({name:"u-line-progress",mixins:[s,r,e({props:{activeColor:{type:String,default:()=>t.lineProgress.activeColor},inactiveColor:{type:String,default:()=>t.lineProgress.color},percentage:{type:[String,Number],default:()=>t.lineProgress.inactiveColor},showText:{type:Boolean,default:()=>t.lineProgress.showText},height:{type:[String,Number],default:()=>t.lineProgress.height}}})],data:()=>({lineWidth:0}),watch:{percentage(e){this.resizeProgressWidth()}},computed:{progressStyle(){let e={};return e.width=this.lineWidth,e.backgroundColor=this.activeColor,e.height=i(this.height),e},innserPercentage(){return o(0,100,this.percentage)}},mounted(){this.init()},methods:{addStyle:a,addUnit:i,init(){n(20).then((()=>{this.resizeProgressWidth()}))},getProgressWidth(){return this.$uGetRect(".u-line-progress__background")},resizeProgressWidth(){this.getProgressWidth().then((e=>{const{width:t}=e;this.lineWidth=t*this.innserPercentage/100+"px"}))}}},[["render",function(e,t,s,r,i,o){const a=P,n=f;return l(),g(a,{class:"u-line-progress",style:u([o.addStyle(e.customStyle)])},{default:d((()=>[h(a,{class:"u-line-progress__background",ref:"u-line-progress__background",style:u([{backgroundColor:e.inactiveColor,height:o.addUnit(e.height)}])},null,8,["style"]),h(a,{class:"u-line-progress__line",style:u([o.progressStyle])},{default:d((()=>[c(e.$slots,"default",{},(()=>[e.showText&&e.percentage>=10?(l(),g(n,{key:0,class:"u-line-progress__text"},{default:d((()=>[p(_(o.innserPercentage+"%"),1)])),_:1})):y("",!0)]),!0)])),_:3},8,["style"])])),_:3},8,["style"])}],["__scopeId","data-v-443e8311"]]);export{x as _};