mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{c as L,e as S,i}from"./use-translate.d2900b8c.js";import{n as o,t as V,u,w as D}from"./with-install.19a35764.js";import{r as I,u as y}from"./use-route.82f2be69.js";import{I as m}from"./index.b70c9b40.js";import{z as B,e as t}from"./vue-libs.b44bc779.js";const[z,a]=L("cell"),q={icon:String,size:String,title:o,value:o,label:o,center:Boolean,isLink:Boolean,border:V,required:Boolean,iconPrefix:String,valueClass:u,labelClass:u,titleClass:u,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},N=S({},q,I),R=B({name:z,props:N,setup(e,{slots:n}){const h=y(),C=()=>{if(n.label||i(e.label))return t("div",{class:[a("label"),e.labelClass]},[n.label?n.label():e.label])},v=()=>{if(n.title||i(e.title))return t("div",{class:[a("title"),e.titleClass],style:e.titleStyle},[n.title?n.title():t("span",null,[e.title]),C()])},w=()=>{const l=n.value||n.default;if(l||i(e.value)){const r=n.title||i(e.title);return t("div",{class:[a("value",{alone:!r}),e.valueClass]},[l?l():t("span",null,[e.value])])}},g=()=>{if(n.icon)return n.icon();if(e.icon)return t(m,{name:e.icon,class:a("left-icon"),classPrefix:e.iconPrefix},null)},P=()=>{if(n["right-icon"])return n["right-icon"]();if(e.isLink){const l=e.arrowDirection&&e.arrowDirection!=="right"?`arrow-${e.arrowDirection}`:"arrow";return t(m,{name:l,class:a("right-icon")},null)}};return()=>{var f,b;const{size:l,center:s,border:r,isLink:k,required:x}=e,c=(f=e.clickable)!=null?f:k,d={center:s,required:x,clickable:c,borderless:!r};return l&&(d[l]=!!l),t("div",{class:a(d),role:c?"button":void 0,tabindex:c?0:void 0,onClick:h},[g(),v(),w(),P(),(b=n.extra)==null?void 0:b.call(n)])}}}),T=D(R),F=T;export{T as C,F as V,q as c};
|