uv-ui
Version:
基于vue3的移动端组件库
2 lines (1 loc) • 1.74 kB
JavaScript
;const e=require("vue"),i=require("../skeleton-paragraph/index.cjs"),c=require("../skeleton-title/index.cjs"),s=require("../skeleton-avatar/index.cjs"),d=require("../../utils/common.cjs");require("./skeleton.vue_vue_type_style_index_0_lang.cjs");const k={class:"uv-skeleton"},m={class:"uv-skeleton-content-right"},f={key:1},v={name:"UvSkeleton"},y=Object.assign(v,{props:{row:{type:Number,default:0},title:{type:Boolean,default:!1},titleWidth:{type:String,default:"40%"},animate:{type:Boolean,default:!0},round:{type:Boolean,default:!1},avatar:{type:Boolean,default:!1},avatarShape:{type:String,default:"round"},rowWidth:{type:[Number,String,Array],default:"100%"},loading:{type:Boolean,default:!0}},setup(t){const r=t,l="60%",u=n=>{const{rowWidth:o}=r;return o==="100%"&&n===+r.row-1?l:Array.isArray(o)?o[n]:o};return(n,o)=>(e.openBlock(),e.createElementBlock("div",k,[t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["uv-skeleton-content",[t.animate?"uv-skeleton-animate":""]])},[e.renderSlot(n.$slots,"template",{},()=>[t.avatar?(e.openBlock(),e.createBlock(e.unref(s),{key:0,"avatar-shape":t.avatarShape},null,8,["avatar-shape"])):e.createCommentVNode("",!0),e.createElementVNode("div",m,[t.title?(e.openBlock(),e.createBlock(e.unref(c),{key:0,round:t.round,"title-width":t.titleWidth},null,8,["round","title-width"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Array(t.row).fill(""),(h,a)=>(e.openBlock(),e.createBlock(e.unref(i),{round:t.round,key:a,"row-width":e.unref(d.addUnit)(u(a))},null,8,["round","row-width"]))),128))])])],2)):(e.openBlock(),e.createElementBlock("div",f,[e.renderSlot(n.$slots,"default")]))]))}});module.exports=y;