2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
import{e,C as t,o as s,c as a,w as l,b as r,n as o,R as i,j as f,t as n,h as u,d as c,bm as p,i as d,p as _}from"./index-8146d74e.js";import{_ as y}from"./_plugin-vue_export-helper.1b428a4d.js";const m=y(e({__name:"price",props:{content:{default:""},prec:{default:2},autoPrec:{type:Boolean,default:!0},color:{default:"#FA8919"},mainSize:{default:"36rpx"},minorSize:{default:"28rpx"},lineThrough:{type:Boolean,default:!1},fontWeight:{default:"normal"},prefix:{default:"¥"},suffix:{default:""}},setup(e){const y=e,m=t(()=>p({price:y.content,take:"int"})),x=t(()=>{let e=p({price:y.content,take:"dec",prec:y.prec});return e=e%10==0?e.substr(0,e.length-1):e,y.autoPrec?1*e?"."+e:"":y.prec?"."+e:""});return(t,p)=>{const y=d,h=_;return s(),a(y,{class:"price-container"},{default:l(()=>[r(y,{class:c(["price-wrap",{"price-wrap--disabled":e.lineThrough}]),style:o({color:e.color})},{default:l(()=>[r(y,{class:"fix-pre",style:o({fontSize:e.minorSize})},{default:l(()=>[i(t.$slots,"prefix",{},()=>[f(n(e.prefix),1)],!0)]),_:3},8,["style"]),r(y,{style:o({"font-weight":e.fontWeight})},{default:l(()=>[r(h,{style:o({fontSize:e.mainSize})},{default:l(()=>[f(n(u(m)),1)]),_:1},8,["style"]),r(h,{style:o({fontSize:e.minorSize})},{default:l(()=>[f(n(u(x)),1)]),_:1},8,["style"])]),_:1},8,["style"]),r(y,{class:"fix-suf",style:o({fontSize:e.minorSize})},{default:l(()=>[i(t.$slots,"suffix",{},()=>[f(n(e.suffix),1)],!0)]),_:3},8,["style"])]),_:3},8,["class","style"])]),_:3})}}}),[["__scopeId","data-v-a74822ce"]]);export{m as _};
|