2 lines
1.6 KiB
JavaScript
Executable File
2 lines
1.6 KiB
JavaScript
Executable File
import{e,C as t,o as s,c as a,w as l,b as r,k as i,n as o,R as f,j as n,t as u,h as c,d as p,bt as d,i as x,p as _}from"./index-af8b4f0a.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((()=>d({price:y.content,take:"int"}))),S=t((()=>{let e=d({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,d)=>{const y=x,h=_;return s(),a(y,{class:"price-container"},{default:l((()=>[r(y,{class:p(["price-wrap",{"price-wrap--disabled":e.lineThrough}]),style:o({color:e.color})},{default:l((()=>[i(" Prefix "),r(y,{class:"fix-pre",style:o({fontSize:e.minorSize})},{default:l((()=>[f(t.$slots,"prefix",{},(()=>[n(u(e.prefix),1)]),!0)])),_:3},8,["style"]),i(" Content "),r(y,{style:o({"font-weight":e.fontWeight})},{default:l((()=>[i(" Integer "),r(h,{style:o({fontSize:e.mainSize})},{default:l((()=>[n(u(c(m)),1)])),_:1},8,["style"]),i(" Decimals "),r(h,{style:o({fontSize:e.minorSize})},{default:l((()=>[n(u(c(S)),1)])),_:1},8,["style"])])),_:1},8,["style"]),i(" Suffix "),r(y,{class:"fix-suf",style:o({fontSize:e.minorSize})},{default:l((()=>[f(t.$slots,"suffix",{},(()=>[n(u(e.suffix),1)]),!0)])),_:3},8,["style"])])),_:3},8,["class","style"])])),_:3})}}}),[["__scopeId","data-v-a74822ce"]]);export{m as _};
|