mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-04 20:31:10 +00:00
2 lines
1.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
import{u as f}from"./poster-7c65d559.js";import{d as s,X as l,h as p,c,t as v,u as a,aH as d}from"./index-9f163f98.js";const h=s({__name:"preview-text",props:{value:{type:Object,default:{}}},setup(i,{expose:n}){const e=i;f();const u=l(()=>e.value),r=l(()=>{let t="";t+=`font-size: ${e.value.fontSize}px;color: ${e.value.fontColor};line-height: ${e.value.lineHeight+e.value.fontSize}px;`,(e.value.x=="left"||e.value.x=="center"||e.value.x=="right")&&(t+=`text-align: ${e.value.x};`),e.value.weight&&(t+="font-weight: bold;"),(!e.value.fontFamily||e.value.fontFamily=="static/font/PingFang-Medium.ttf")&&(t+="font-family: poster_default_font;");let o=document.getElementById(e.value.id);return o?t+=`width:${o.offsetWidth}px;height:${o.offsetHeight}px;`:t+=`width:${e.value.width}px;height:${e.value.height}px;`,t});return n({}),(t,o)=>(p(),c("div",{class:"overflow-hidden",style:d(a(r))},v(a(u).value),5))}}),g=Object.freeze(Object.defineProperty({__proto__:null,default:h},Symbol.toStringTag,{value:"Module"}));export{g as _};
|