物管理前端
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 lines
1.1 KiB

import{d as a,s as r,t as l,o as c,b as d,M as f,J as u,K as m,k as x,p as g}from"./index-bVOhw2NF.js";import{a as p}from"./common-CalHcBJp.js";const y=["contenteditable"],S=a({__name:"TextEditor",props:{editable:{type:Boolean,default:!1},text:{type:String}},setup(e){const s=e,n=r();function o(){if(!n.value)return;const t=document.createRange();t.selectNode(n.value),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}return l(()=>[s.editable],()=>{s.editable&&o()}),(t,h)=>(c(),d("div",{ref_key:"textRef",ref:n,class:x(["es-text",[{editable:e.editable}]]),contenteditable:e.editable},[f(t.$slots,"default",{},()=>[u(m(e.text),1)],!0)],10,y))}}),_=g(S,[["__scopeId","data-v-d0858756"]]),b=["fontSize","lineHeight","borderWidth","borderRadius"],i=["fontSize","fontWeight","fontFamily","color","lineHeight","fontStyle","textDecoration","justifyContent","alignItems"];function v(e,s=!0){if(!e)return e;const n={},o=Object.keys(e).filter(t=>s?i.includes(t):!i.includes(t));for(const t of o)n[t]=b.includes(t)?p(e[t]):e[t];return n}function w(e,s){return Object.keys(e).reduce((n,o)=>(s.includes(o)||(n[o]=e[o]),n),{})}export{_ as T,w as o,v as p};