little-dizzy 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/little-dizzy.css +1 -1
- package/dist/little-dizzy.js +427 -348
- package/dist/little-dizzy.umd.cjs +6 -6
- package/package.json +3 -3
- package/src/index.js +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.LittleDizzy={},d.Vue))})(this,(function(d,e){"use strict";const B=(t,o)=>{const l=t.__vccOpts||t;for(const[a,c]of o)l[a]=c;return l},G=["disabled"],N=B({__name:"Button",props:{type:{type:String,default:"primary",validator:t=>["primary","success","warning","danger","info","secondary"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){return(l,a)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["btn",[`btn-${t.type}`,`btn-${t.size}`,{"btn-block":t.block},{"btn-disabled":t.disabled}]]),disabled:t.disabled,onClick:a[0]||(a[0]=c=>l.$emit("click",c))},[e.renderSlot(l.$slots,"default",{},void 0,!0)],10,G))}},[["__scopeId","data-v-75f082b2"]]),W={key:0,class:"card-header"},X={key:0,class:"card-header-title"},K={class:"card-body"},J={key:1,class:"card-footer"},L=B({__name:"Card",props:{title:{type:String,default:""},shadow:{type:Boolean,default:!0}},setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["card",{"card-shadow":t.shadow}])},[o.$slots.header||t.title?(e.openBlock(),e.createElementBlock("div",W,[t.title?(e.openBlock(),e.createElementBlock("h3",X,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"header",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.renderSlot(o.$slots,"default",{},void 0,!0)]),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(o.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},[["__scopeId","data-v-1e2b2467"]]),Q={class:"modal-dialog"},Z={class:"modal-header"},ee={key:0,class:"modal-header-title"},te={class:"modal-body"},oe={key:0,class:"modal-footer"},ne={key:1,class:"modal-footer"},M=B({__name:"Modal",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"500px"},showFooter:{type:Boolean,default:!0}},emits:["close","cancel","confirm"],setup(t,{emit:o}){const l=o,a=()=>{l("close")},c=()=>{l("cancel")},r=()=>{l("confirm")};return(n,g)=>t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"modal-show":t.visible}])},[e.createElementVNode("div",Q,[e.createElementVNode("div",{class:"modal-content",style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",Z,[t.title?(e.openBlock(),e.createElementBlock("h3",ee,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"modal-header-close",onClick:a},"×")]),e.createElementVNode("div",te,[e.renderSlot(n.$slots,"default",{},void 0,!0)]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(n.$slots,"footer",{},void 0,!0)])):t.showFooter?(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("button",{class:"btn btn-secondary",onClick:c},"取消"),e.createElementVNode("button",{class:"btn btn-primary",onClick:r},"确定")])):e.createCommentVNode("",!0)],4)])],2)):e.createCommentVNode("",!0)}},[["__scopeId","data-v-39af2dcd"]]),le=["innerHTML"],ae={class:"text-sm font-medium"},se=["onClick"],T=B(Object.assign({name:"Message"},{__name:"Message",setup(t,{expose:o}){const l=e.ref([]),a={success:"bg-emerald-500/95 text-white",warning:"bg-amber-500/95 text-white",error:"bg-rose-500/95 text-white",info:"bg-sky-500/95 text-white"},c={success:`<svg class="w-5 h-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
2
2
|
<path d="M20 6L9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
3
|
</svg>`,warning:`<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
|
|
4
4
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<path d="M15 9l-6 6M9 9l6 6" stroke-linecap="round"/>
|
|
8
8
|
</svg>`,info:`<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
|
|
9
9
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
|
|
10
|
-
</svg>`};let r=0;const a=m=>{const s=++r,d={id:s,type:m.type||"info",content:m.content||"",duration:m.duration??3e3,closable:m.closable??!1};return n.value.push(d),d.duration>0&&setTimeout(()=>{g(s)},d.duration),s},g=m=>{const s=n.value.findIndex(d=>d.id===m);s>-1&&n.value.splice(s,1)};return o({addMessage:a,removeMessage:g,clearAll:()=>{n.value=[]},success:(m,s={})=>a({...s,type:"success",content:m}),warning:(m,s={})=>a({...s,type:"warning",content:m}),error:(m,s={})=>a({...s,type:"error",content:m}),info:(m,s={})=>a({...s,type:"info",content:m})}),(m,s)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"message",tag:"div",class:"fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col items-center gap-3 pointer-events-none"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:e.normalizeClass(["pointer-events-auto flex items-center gap-3 px-5 py-3 rounded-lg shadow-lg backdrop-blur-sm transition-all duration-300",l[d.type]])},[e.createElementVNode("span",{class:"flex-shrink-0",innerHTML:c[d.type]},null,8,ne),e.createElementVNode("span",ae,e.toDisplayString(d.content),1),d.closable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:C=>g(d.id),class:"flex-shrink-0 ml-2 p-1 rounded-full hover:bg-black/10 transition-colors"},[...s[0]||(s[0]=[e.createElementVNode("svg",{class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,le)):e.createCommentVNode("",!0)],2))),128))]),_:1})]))}}),[["__scopeId","data-v-d727fd6c"]]),se=["src","alt"],re={key:1,class:"slide-title"},ce={key:0,class:"carousel-indicators"},ie=["onClick"],de={viewBox:"0 0 24 24",width:"24",height:"24"},me=["d"],pe={viewBox:"0 0 24 24",width:"24",height:"24"},ge=["d"],T=b(Object.assign({name:"Carousel"},{__name:"Carousel",props:{items:{type:Array,default:()=>[]},height:{type:String,default:"300px"},direction:{type:String,default:"horizontal",validator:t=>["horizontal","vertical"].includes(t)},autoplay:{type:Boolean,default:!0},interval:{type:Number,default:3e3},showIndicators:{type:Boolean,default:!0},showArrows:{type:Boolean,default:!0}},emits:["change"],setup(t,{expose:o,emit:n}){const l=t,c=n,r=e.ref(0);let a=null;const g=e.computed(()=>{const y=r.value*100;return l.direction==="vertical"?{transform:`translateY(-${y}%)`}:{transform:`translateX(-${y}%)`}}),u=()=>{r.value=(r.value+1)%l.items.length,c("change",r.value)},m=()=>{r.value=(r.value-1+l.items.length)%l.items.length,c("change",r.value)},s=y=>{r.value=y,c("change",r.value)},d=()=>{l.autoplay&&l.items.length>1&&(a=setInterval(u,l.interval))},C=()=>{a&&(clearInterval(a),a=null)};return e.onMounted(()=>{d()}),e.onUnmounted(()=>{C()}),o({next:u,prev:m,goTo:s,currentIndex:r}),(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ld-carousel",{"ld-carousel--vertical":t.direction==="vertical"}]),style:e.normalizeStyle({height:t.height})},[e.createElementVNode("div",{class:"carousel-container",style:e.normalizeStyle(g.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(w,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:e.normalizeClass(["carousel-slide",{active:_===r.value}])},[e.renderSlot(y.$slots,"item",{item:w,index:_},()=>[w.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:w.image,alt:w.title||""},null,8,se)):e.createCommentVNode("",!0),w.title?(e.openBlock(),e.createElementBlock("div",re,e.toDisplayString(w.title),1)):e.createCommentVNode("",!0)],!0)],2))),128))],4),t.showIndicators?(e.openBlock(),e.createElementBlock("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(w,_)=>(e.openBlock(),e.createElementBlock("span",{key:_,class:e.normalizeClass(["indicator",{active:_===r.value}]),onClick:V=>s(_)},null,10,ie))),128))])):e.createCommentVNode("",!0),t.showArrows?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{class:"carousel-arrow prev",onClick:m},[(e.openBlock(),e.createElementBlock("svg",de,[e.createElementVNode("path",{fill:"currentColor",d:t.direction==="vertical"?"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z":"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"},null,8,me)]))]),e.createElementVNode("button",{class:"carousel-arrow next",onClick:u},[(e.openBlock(),e.createElementBlock("svg",pe,[e.createElementVNode("path",{fill:"currentColor",d:t.direction==="vertical"?"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z":"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},null,8,ge)]))])],64)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-42bf1623"]]),fe={key:1,class:"dots"},ue={key:4,class:"bars"},ye={key:5,class:"loading-text"},D=b(Object.assign({name:"Loading"},{__name:"Loading",props:{type:{type:String,default:"spinner",validator:t=>["spinner","dots","ring","pulse","bars"].includes(t)},size:{type:String,default:"40px"},color:{type:String,default:"var(--ld-color-primary, #6366f1)"},text:{type:String,default:""},fullscreen:{type:Boolean,default:!1}},setup(t){const o=t,n=e.computed(()=>({width:o.size,height:o.size,"--spinner-color":o.color})),l=e.computed(()=>({width:o.size,height:o.size,"--ring-color":o.color}));return(c,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ld-loading",[`ld-loading--${t.type}`,{"ld-loading--fullscreen":t.fullscreen}]])},[t.type==="spinner"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spinner",style:e.normalizeStyle(n.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(12,a=>e.createElementVNode("div",{key:a,class:"spinner-blade"})),64))],4)):t.type==="dots"?(e.openBlock(),e.createElementBlock("div",fe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,a=>e.createElementVNode("span",{key:a,class:"dot",style:e.normalizeStyle({background:t.color})},null,4)),64))])):t.type==="ring"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"ring",style:e.normalizeStyle(l.value)},[...r[0]||(r[0]=[e.createElementVNode("div",{class:"ring-inner"},null,-1)])],4)):t.type==="pulse"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"pulse",style:e.normalizeStyle({background:t.color,width:t.size,height:t.size})},null,4)):t.type==="bars"?(e.openBlock(),e.createElementBlock("div",ue,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,a=>e.createElementVNode("span",{key:a,class:"bar",style:e.normalizeStyle({background:t.color})},null,4)),64))])):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("div",ye,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-5052ea89"]]),he={key:0,class:"ld-table-loading"},ke={key:0,class:"loading-text"},Be={class:"ld-table"},be=["onClick"],we={class:"th-content"},_e={key:0},Ee=["colspan"],ze=["onClick"],A=b(Object.assign({name:"ldTable"},{__name:"Table",props:{columns:{type:Array,required:!0},data:{type:Array,default:()=>[]},bordered:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{type:String,default:""},api:{type:Function,default:null},autoLoad:{type:Boolean,default:!0},loadParams:{type:Object,default:()=>({})}},emits:["row-click","load-success","load-error"],setup(t,{expose:o,emit:n}){const l=t,c=n,r=e.ref(!1),a=e.ref([]),g=e.computed(()=>typeof l.api=="function"),u=e.computed(()=>l.loading||r.value),m=e.computed(()=>g.value?a.value:l.data),s=async(f={})=>{if(g.value){r.value=!0;try{const h={...l.loadParams,...f},p=await l.api(h);return a.value=Array.isArray(p)?p:p?.data||p?.list||[],c("load-success",a.value),a.value}catch(h){throw console.error("[ld-table] Load error:",h),c("load-error",h),h}finally{r.value=!1}}},d=(f={})=>s(f),C=()=>{a.value=[]};e.watch(()=>l.loadParams,f=>{g.value&&l.autoLoad&&s()},{deep:!0}),e.onMounted(()=>{g.value&&l.autoLoad&&s()});const y=e.ref(""),k=e.ref(""),w=f=>{y.value===f?(k.value=k.value==="asc"?"desc":k.value==="desc"?"":"asc",k.value||(y.value="")):(y.value=f,k.value="asc")},_=f=>y.value!==f?"":k.value==="asc"?"sort-asc":k.value==="desc"?"sort-desc":"",V=e.computed(()=>{const f=m.value;return!y.value||!k.value?f:[...f].sort((h,p)=>{const E=h[y.value],B=p[y.value];if(typeof E=="number"&&typeof B=="number")return k.value==="asc"?E-B:B-E;const R=String(E||""),U=String(B||"");return k.value==="asc"?R.localeCompare(U):U.localeCompare(R)})});return o({load:s,reload:d,clear:C,getData:()=>a.value}),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ld-table-wrapper",{"ld-table--bordered":t.bordered,"ld-table--striped":t.striped}])},[u.value?(e.openBlock(),e.createElementBlock("div",he,[h[0]||(h[0]=e.createElementVNode("div",{class:"loading-spinner"},[e.createElementVNode("svg",{class:"circular",viewBox:"0 0 50 50"},[e.createElementVNode("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})])],-1)),t.loadingText?(e.openBlock(),e.createElementBlock("span",ke,e.toDisplayString(t.loadingText),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",Be,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,p=>(e.openBlock(),e.createElementBlock("th",{key:p.key,style:e.normalizeStyle({width:p.width,textAlign:p.align||"left"}),onClick:E=>p.sortable&&w(p.key)},[e.createElementVNode("div",we,[e.createElementVNode("span",null,e.toDisplayString(p.title),1),p.sortable?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sort-icon",_(p.key)])},[...h[1]||(h[1]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[e.createElementVNode("path",{fill:"currentColor",d:"M7 10l5-5 5 5H7zm0 4l5 5 5-5H7z"})],-1)])],2)):e.createCommentVNode("",!0)])],12,be))),128))])]),e.createElementVNode("tbody",null,[!V.value.length&&!u.value?(e.openBlock(),e.createElementBlock("tr",_e,[e.createElementVNode("td",{colspan:t.columns.length,class:"empty-cell"},[e.renderSlot(f.$slots,"empty",{},()=>[h[2]||(h[2]=e.createStaticVNode('<div class="empty-content" data-v-567f3024><svg viewBox="0 0 64 41" width="64" height="41" data-v-567f3024><g transform="translate(0 1)" fill="none" fill-rule="evenodd" data-v-567f3024><ellipse fill="var(--ld-color-bg-secondary, #f5f5f5)" cx="32" cy="33" rx="32" ry="7" data-v-567f3024></ellipse><g fill-rule="nonzero" stroke="var(--ld-color-border, #d9d9d9)" data-v-567f3024><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" data-v-567f3024></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="var(--ld-color-bg, #fafafa)" data-v-567f3024></path></g></g></svg><span data-v-567f3024>暂无数据</span></div>',1))],!0)],8,Ee)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(p,E)=>(e.openBlock(),e.createElementBlock("tr",{key:E,onClick:B=>f.$emit("row-click",p,E)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,B=>(e.openBlock(),e.createElementBlock("td",{key:B.key,style:e.normalizeStyle({textAlign:B.align||"left"})},[e.renderSlot(f.$slots,B.key,{row:p,index:E,value:p[B.key]},()=>[e.createTextVNode(e.toDisplayString(p[B.key]),1)],!0)],4))),128))],8,ze))),128))])])],2))}}),[["__scopeId","data-v-567f3024"]]);e.ref([]);let Ce=0;const Se=t=>{const o=++Ce,n=t.type||"info",l=t.content||"",c=t.duration??3e3,r=t.closable??!1,a=document.createElement("div");a.className=`ld-message ld-message--${n}`,a.setAttribute("data-id",o);let u=`${{success:`<svg class="ld-message-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
10
|
+
</svg>`};let r=0;const n=m=>{const s=++r,i={id:s,type:m.type||"info",content:m.content||"",duration:m.duration??3e3,closable:m.closable??!1};return l.value.push(i),i.duration>0&&setTimeout(()=>{g(s)},i.duration),s},g=m=>{const s=l.value.findIndex(i=>i.id===m);s>-1&&l.value.splice(s,1)};return o({addMessage:n,removeMessage:g,clearAll:()=>{l.value=[]},success:(m,s={})=>n({...s,type:"success",content:m}),warning:(m,s={})=>n({...s,type:"warning",content:m}),error:(m,s={})=>n({...s,type:"error",content:m}),info:(m,s={})=>n({...s,type:"info",content:m})}),(m,s)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"message",tag:"div",class:"fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col items-center gap-3 pointer-events-none"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:e.normalizeClass(["pointer-events-auto flex items-center gap-3 px-5 py-3 rounded-lg shadow-lg backdrop-blur-sm transition-all duration-300",a[i.type]])},[e.createElementVNode("span",{class:"flex-shrink-0",innerHTML:c[i.type]},null,8,le),e.createElementVNode("span",ae,e.toDisplayString(i.content),1),i.closable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:C=>g(i.id),class:"flex-shrink-0 ml-2 p-1 rounded-full hover:bg-black/10 transition-colors"},[...s[0]||(s[0]=[e.createElementVNode("svg",{class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,se)):e.createCommentVNode("",!0)],2))),128))]),_:1})]))}}),[["__scopeId","data-v-d727fd6c"]]),re=["src","alt"],ce={key:1,class:"slide-title"},ie={key:0,class:"carousel-indicators"},de=["onClick"],me={viewBox:"0 0 24 24",width:"24",height:"24"},pe=["d"],ge={viewBox:"0 0 24 24",width:"24",height:"24"},fe=["d"],I=B(Object.assign({name:"Carousel"},{__name:"Carousel",props:{items:{type:Array,default:()=>[]},height:{type:String,default:"300px"},direction:{type:String,default:"horizontal",validator:t=>["horizontal","vertical"].includes(t)},autoplay:{type:Boolean,default:!0},interval:{type:Number,default:3e3},showIndicators:{type:Boolean,default:!0},showArrows:{type:Boolean,default:!0}},emits:["change"],setup(t,{expose:o,emit:l}){const a=t,c=l,r=e.ref(0);let n=null;const g=e.computed(()=>{const f=r.value*100;return a.direction==="vertical"?{transform:`translateY(-${f}%)`}:{transform:`translateX(-${f}%)`}}),u=()=>{r.value=(r.value+1)%a.items.length,c("change",r.value)},m=()=>{r.value=(r.value-1+a.items.length)%a.items.length,c("change",r.value)},s=f=>{r.value=f,c("change",r.value)},i=()=>{a.autoplay&&a.items.length>1&&(n=setInterval(u,a.interval))},C=()=>{n&&(clearInterval(n),n=null)};return e.onMounted(()=>{i()}),e.onUnmounted(()=>{C()}),o({next:u,prev:m,goTo:s,currentIndex:r}),(f,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ld-carousel",{"ld-carousel--vertical":t.direction==="vertical"}]),style:e.normalizeStyle({height:t.height})},[e.createElementVNode("div",{class:"carousel-container",style:e.normalizeStyle(g.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(w,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:e.normalizeClass(["carousel-slide",{active:_===r.value}])},[e.renderSlot(f.$slots,"item",{item:w,index:_},()=>[w.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:w.image,alt:w.title||""},null,8,re)):e.createCommentVNode("",!0),w.title?(e.openBlock(),e.createElementBlock("div",ce,e.toDisplayString(w.title),1)):e.createCommentVNode("",!0)],!0)],2))),128))],4),t.showIndicators?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(w,_)=>(e.openBlock(),e.createElementBlock("span",{key:_,class:e.normalizeClass(["indicator",{active:_===r.value}]),onClick:V=>s(_)},null,10,de))),128))])):e.createCommentVNode("",!0),t.showArrows?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{class:"carousel-arrow prev",onClick:m},[(e.openBlock(),e.createElementBlock("svg",me,[e.createElementVNode("path",{fill:"currentColor",d:t.direction==="vertical"?"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z":"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"},null,8,pe)]))]),e.createElementVNode("button",{class:"carousel-arrow next",onClick:u},[(e.openBlock(),e.createElementBlock("svg",ge,[e.createElementVNode("path",{fill:"currentColor",d:t.direction==="vertical"?"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z":"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},null,8,fe)]))])],64)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-42bf1623"]]),ue={key:1,class:"dots"},he={key:4,class:"bars"},ye={key:5,class:"loading-text"},v=B(Object.assign({name:"Loading"},{__name:"Loading",props:{type:{type:String,default:"spinner",validator:t=>["spinner","dots","ring","pulse","bars"].includes(t)},size:{type:String,default:"40px"},color:{type:String,default:"var(--ld-color-primary, #6366f1)"},text:{type:String,default:""},fullscreen:{type:Boolean,default:!1}},setup(t){const o=t,l=e.computed(()=>({width:o.size,height:o.size,"--spinner-color":o.color})),a=e.computed(()=>({width:o.size,height:o.size,"--ring-color":o.color}));return(c,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ld-loading",[`ld-loading--${t.type}`,{"ld-loading--fullscreen":t.fullscreen}]])},[t.type==="spinner"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"spinner",style:e.normalizeStyle(l.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(12,n=>e.createElementVNode("div",{key:n,class:"spinner-blade"})),64))],4)):t.type==="dots"?(e.openBlock(),e.createElementBlock("div",ue,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,n=>e.createElementVNode("span",{key:n,class:"dot",style:e.normalizeStyle({background:t.color})},null,4)),64))])):t.type==="ring"?(e.openBlock(),e.createElementBlock("div",{key:2,class:"ring",style:e.normalizeStyle(a.value)},[...r[0]||(r[0]=[e.createElementVNode("div",{class:"ring-inner"},null,-1)])],4)):t.type==="pulse"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"pulse",style:e.normalizeStyle({background:t.color,width:t.size,height:t.size})},null,4)):t.type==="bars"?(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,n=>e.createElementVNode("span",{key:n,class:"bar",style:e.normalizeStyle({background:t.color})},null,4)),64))])):e.createCommentVNode("",!0),t.text?(e.openBlock(),e.createElementBlock("div",ye,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-5052ea89"]]),ke={key:0,class:"ld-table-loading"},Be={key:0,class:"loading-text"},be={class:"ld-table"},we=["onClick"],_e={class:"th-content"},Ee={key:0},Ce=["colspan"],ze=["onClick"],D=B(Object.assign({name:"ldTable"},{__name:"Table",props:{columns:{type:Array,required:!0},data:{type:Array,default:()=>[]},bordered:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{type:String,default:""},api:{type:Function,default:null},autoLoad:{type:Boolean,default:!0},loadParams:{type:Object,default:()=>({})}},emits:["row-click","load-success","load-error"],setup(t,{expose:o,emit:l}){const a=t,c=l,r=e.ref(!1),n=e.ref([]),g=e.computed(()=>typeof a.api=="function"),u=e.computed(()=>a.loading||r.value),m=e.computed(()=>g.value?n.value:a.data),s=async(h={})=>{if(g.value){r.value=!0;try{const k={...a.loadParams,...h},p=await a.api(k);return n.value=Array.isArray(p)?p:p?.data||p?.list||[],c("load-success",n.value),n.value}catch(k){throw console.error("[ld-table] Load error:",k),c("load-error",k),k}finally{r.value=!1}}},i=(h={})=>s(h),C=()=>{n.value=[]};e.watch(()=>a.loadParams,h=>{g.value&&a.autoLoad&&s()},{deep:!0}),e.onMounted(()=>{g.value&&a.autoLoad&&s()});const f=e.ref(""),y=e.ref(""),w=h=>{f.value===h?(y.value=y.value==="asc"?"desc":y.value==="desc"?"":"asc",y.value||(f.value="")):(f.value=h,y.value="asc")},_=h=>f.value!==h?"":y.value==="asc"?"sort-asc":y.value==="desc"?"sort-desc":"",V=e.computed(()=>{const h=m.value;return!f.value||!y.value?h:[...h].sort((k,p)=>{const E=k[f.value],b=p[f.value];if(typeof E=="number"&&typeof b=="number")return y.value==="asc"?E-b:b-E;const U=String(E||""),q=String(b||"");return y.value==="asc"?U.localeCompare(q):q.localeCompare(U)})});return o({load:s,reload:i,clear:C,getData:()=>n.value}),(h,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ld-table-wrapper",{"ld-table--bordered":t.bordered,"ld-table--striped":t.striped}])},[u.value?(e.openBlock(),e.createElementBlock("div",ke,[k[0]||(k[0]=e.createElementVNode("div",{class:"loading-spinner"},[e.createElementVNode("svg",{class:"circular",viewBox:"0 0 50 50"},[e.createElementVNode("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})])],-1)),t.loadingText?(e.openBlock(),e.createElementBlock("span",Be,e.toDisplayString(t.loadingText),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",be,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,p=>(e.openBlock(),e.createElementBlock("th",{key:p.key,style:e.normalizeStyle({width:p.width,textAlign:p.align||"left"}),onClick:E=>p.sortable&&w(p.key)},[e.createElementVNode("div",_e,[e.createElementVNode("span",null,e.toDisplayString(p.title),1),p.sortable?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sort-icon",_(p.key)])},[...k[1]||(k[1]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[e.createElementVNode("path",{fill:"currentColor",d:"M7 10l5-5 5 5H7zm0 4l5 5 5-5H7z"})],-1)])],2)):e.createCommentVNode("",!0)])],12,we))),128))])]),e.createElementVNode("tbody",null,[!V.value.length&&!u.value?(e.openBlock(),e.createElementBlock("tr",Ee,[e.createElementVNode("td",{colspan:t.columns.length,class:"empty-cell"},[e.renderSlot(h.$slots,"empty",{},()=>[k[2]||(k[2]=e.createStaticVNode('<div class="empty-content" data-v-567f3024><svg viewBox="0 0 64 41" width="64" height="41" data-v-567f3024><g transform="translate(0 1)" fill="none" fill-rule="evenodd" data-v-567f3024><ellipse fill="var(--ld-color-bg-secondary, #f5f5f5)" cx="32" cy="33" rx="32" ry="7" data-v-567f3024></ellipse><g fill-rule="nonzero" stroke="var(--ld-color-border, #d9d9d9)" data-v-567f3024><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" data-v-567f3024></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="var(--ld-color-bg, #fafafa)" data-v-567f3024></path></g></g></svg><span data-v-567f3024>暂无数据</span></div>',1))],!0)],8,Ce)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(p,E)=>(e.openBlock(),e.createElementBlock("tr",{key:E,onClick:b=>h.$emit("row-click",p,E)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,b=>(e.openBlock(),e.createElementBlock("td",{key:b.key,style:e.normalizeStyle({textAlign:b.align||"left"})},[e.renderSlot(h.$slots,b.key,{row:p,index:E,value:p[b.key]},()=>[e.createTextVNode(e.toDisplayString(p[b.key]),1)],!0)],4))),128))],8,ze))),128))])])],2))}}),[["__scopeId","data-v-567f3024"]]),A=B({__name:"Backtop",props:{visibilityHeight:{type:Number,default:200},right:{type:Number,default:40},bottom:{type:Number,default:40},target:{type:String,default:""}},emits:["click"],setup(t,{expose:o,emit:l}){const a=t,c=l,r=e.ref(!1),n=e.shallowRef(null);e.shallowRef(null);const g=e.computed(()=>({right:`${a.right}px`,bottom:`${a.bottom}px`})),u=()=>a.target?document.querySelector(a.target)??window:window,m=()=>n.value===window?window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0:n.value?.scrollTop??0,s=()=>{r.value=m()>=a.visibilityHeight},i=f=>{C(),c("click",f)},C=()=>{n.value&&(n.value===window?window.scrollTo({top:0,behavior:"smooth"}):n.value.scrollTo({top:0,behavior:"smooth"}))};return e.onMounted(()=>{n.value=u(),n.value&&(n.value.addEventListener("scroll",s,{passive:!0}),s())}),e.onUnmounted(()=>{n.value&&n.value.removeEventListener("scroll",s)}),o({scrollToTop:C}),(f,y)=>(e.openBlock(),e.createBlock(e.Transition,{name:"ld-backtop-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"ld-backtop",style:e.normalizeStyle(g.value),onClick:i},[e.renderSlot(f.$slots,"default",{},()=>[y[0]||(y[0]=e.createElementVNode("svg",{class:"ld-backtop-icon",viewBox:"0 0 24 24",width:"20",height:"20"},[e.createElementVNode("path",{fill:"currentColor",d:"M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"})],-1))],!0)],4),[[e.vShow,r.value]])]),_:3}))}},[["__scopeId","data-v-e2cc7059"]]);e.ref([]);let Se=0;const $e=t=>{const o=++Se,l=t.type||"info",a=t.content||"",c=t.duration??3e3,r=t.closable??!1,n=document.createElement("div");n.className=`ld-message ld-message--${l}`,n.setAttribute("data-id",o);let u=`${{success:`<svg class="ld-message-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
|
11
11
|
<path d="M20 6L9 17l-5-5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
12
|
</svg>`,warning:`<svg class="ld-message-icon" viewBox="0 0 24 24" fill="currentColor">
|
|
13
13
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/>
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
<path d="M15 9l-6 6M9 9l6 6" stroke-linecap="round"/>
|
|
17
17
|
</svg>`,info:`<svg class="ld-message-icon" viewBox="0 0 24 24" fill="currentColor">
|
|
18
18
|
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
|
|
19
|
-
</svg>`}[
|
|
19
|
+
</svg>`}[l]}<span class="ld-message-content">${a}</span>`;return r&&(u+=`<button class="ld-message-close" onclick="window.__ldMessageClose(${o})">
|
|
20
20
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
21
21
|
<path d="M18 6L6 18M6 6l12 12"/>
|
|
22
22
|
</svg>
|
|
23
|
-
</button>`),
|
|
23
|
+
</button>`),n.innerHTML=u,{id:o,element:n,duration:c}},xe=()=>{let t=document.getElementById("ld-message-root");if(!t){t=document.createElement("div"),t.id="ld-message-root",document.body.appendChild(t);const o=document.createElement("style");o.textContent=`
|
|
24
24
|
#ld-message-root {
|
|
25
25
|
position: fixed;
|
|
26
26
|
top: 16px;
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
82
82
|
to { opacity: 0; transform: translateY(-10px) scale(0.95); }
|
|
83
83
|
}
|
|
84
|
-
`,document.head.appendChild(o)}return t},S=t=>{const o=document.getElementById("ld-message-root");if(!o)return;const
|
|
84
|
+
`,document.head.appendChild(o)}return t},S=t=>{const o=document.getElementById("ld-message-root");if(!o)return;const l=o.querySelector(`[data-id="${t}"]`);l&&(l.classList.add("ld-message--closing"),setTimeout(()=>{l.remove()},200))};typeof window<"u"&&(window.__ldMessageClose=S);const z=t=>{const o=xe(),{id:l,element:a,duration:c}=$e(t);return o.appendChild(a),c>0&&setTimeout(()=>{S(l)},c),l},$={success:(t,o={})=>z({...o,type:"success",content:t}),warning:(t,o={})=>z({...o,type:"warning",content:t}),error:(t,o={})=>z({...o,type:"error",content:t}),info:(t,o={})=>z({...o,type:"info",content:t}),close:S,closeAll:()=>{const t=document.getElementById("ld-message-root");t&&(t.innerHTML="")}},Ve={class:"lzbutton-wrapper"},Ne={class:"button"},F=B(Object.assign({name:"Lzbutton"},{__name:"lzbutton",setup(t){return(o,l)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("button",Ne,[l[1]||(l[1]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 24"},[e.createElementVNode("path",{d:"m18 0 8 12 10-8-4 20H4L0 4l10 8 8-12z"})],-1)),e.renderSlot(o.$slots,"default",{},()=>[l[0]||(l[0]=e.createTextVNode("Unlock Pro",-1))],!0)])]))}}),[["__scopeId","data-v-7124b716"]]),Le={class:"Lztext-wrapper"},Me={class:"loader-wrapper"},O=B(Object.assign({name:"Lztext"},{__name:"Lztext",props:{text:{type:String,default:"Generating"}},setup(t){const o=t,l=e.computed(()=>o.text.split(""));return(a,c)=>(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,n)=>(e.openBlock(),e.createElementBlock("span",{key:n,class:"loader-letter",style:e.normalizeStyle({animationDelay:`${.1+n*.105}s`})},e.toDisplayString(r===" "?" ":r),5))),128)),c[0]||(c[0]=e.createElementVNode("div",{class:"loader"},null,-1))])]))}}),[["__scopeId","data-v-2cca50b0"]]),Te={class:"lztheme-wrapper"},Ie={class:"theme__toggle-wrap"},ve=["checked"],j=B(Object.assign({name:"Lztheme"},{__name:"lztheme",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{expose:o,emit:l}){let a=0;const c=`lztheme-toggle-${++a}-${Date.now()}`,r=t,n=l,g=e.ref(null),u=e.ref(r.modelValue);e.watch(()=>r.modelValue,s=>{u.value=s});const m=s=>{const i=s.target.checked;u.value=i,n("update:modelValue",i),n("change",i)};return o({toggle:()=>{g.value&&g.value.click()},setDark:s=>{u.value=s,n("update:modelValue",s),n("change",s)}}),(s,i)=>(e.openBlock(),e.createElementBlock("div",Te,[e.createElementVNode("label",{for:c,class:"theme"},[e.createElementVNode("span",Ie,[e.createElementVNode("input",{id:c,ref_key:"toggleRef",ref:g,class:"theme__toggle",type:"checkbox",role:"switch",name:"theme",value:"dark",checked:u.value,onChange:m},null,40,ve),i[0]||(i[0]=e.createStaticVNode('<span class="theme__icon" data-v-e887d581><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span><span class="theme__icon-part" data-v-e887d581></span></span>',1))])])]))}}),[["__scopeId","data-v-e887d581"]]),H={Lzbutton:F,Lztext:O,Lztheme:j},De=[{name:"Button",type:"vue",label:"Button 按钮",code:`<template>
|
|
85
85
|
<Button type="primary">主要按钮</Button>
|
|
86
86
|
<Button type="success">成功按钮</Button>
|
|
87
87
|
<Button type="warning">警告按钮</Button>
|
|
@@ -215,4 +215,4 @@ const data = [
|
|
|
215
215
|
|
|
216
216
|
<script setup>
|
|
217
217
|
import { Backtop } from 'little-dizzy'
|
|
218
|
-
<\/script>`}],x=new Map;function
|
|
218
|
+
<\/script>`}],x=new Map;function P(t){return!t||!t.name?(console.warn("[LittleDizzy] Snippet must have a name property"),!1):(x.set(t.name,{name:t.name,type:t.type||"html",label:t.label||t.name,code:t.code||"",isCustom:t.isCustom||!1,...t}),!0)}function R(t){if(!Array.isArray(t))return console.warn("[LittleDizzy] registerSnippets expects an array"),0;let o=0;return t.forEach(l=>{P(l)&&o++}),o}function Ae(){const t={};return x.forEach((o,l)=>{t[l]=o}),t}function Fe(t){return x.get(t)}R(De);const Y={Button:N,Card:L,Modal:M,Message:T,Carousel:I,Loading:v,Table:D,Backtop:A,...H},Oe=(t,o={})=>{Object.entries(Y).forEach(([l,a])=>{t.component(o.prefix?`${o.prefix}${l}`:l,a)}),t.config.globalProperties.$message=$,t.provide("message",$)},je=Ae,He=P,Pe=R,Re=Fe,Ye={install:Oe,...Y};d.Backtop=A,d.Button=N,d.Card=L,d.Carousel=I,d.Loading=v,d.Lzbutton=F,d.Lztext=O,d.Lztheme=j,d.Message=T,d.Modal=M,d.Table=D,d.customComponents=H,d.default=Ye,d.getSnippet=Re,d.message=$,d.registerSnippet=He,d.registerSnippets=Pe,d.snippets=je,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "little-dizzy",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "LittleDizzy - 一个支持代码片段的 Vue 3 UI 组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/little-dizzy.umd.cjs",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vue": "^3.0.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"little-dizzy": "^2.
|
|
52
|
+
"little-dizzy": "^2.6.0",
|
|
53
53
|
"vue": "^3.0.0",
|
|
54
54
|
"vue-router": "^4.6.4"
|
|
55
55
|
},
|
|
@@ -60,4 +60,4 @@
|
|
|
60
60
|
"tailwindcss": "^4.1.18",
|
|
61
61
|
"vite": "^7.2.4"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|
package/src/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import Message from './components/Message.vue'
|
|
|
27
27
|
import Carousel from './components/Carousel.vue'
|
|
28
28
|
import Loading from './components/Loading.vue'
|
|
29
29
|
import Table from './components/Table.vue'
|
|
30
|
+
import Backtop from './components/Backtop.vue'
|
|
30
31
|
import { message } from './components/message.js'
|
|
31
32
|
|
|
32
33
|
// 导入自定义组件(由 Demo 上传生成)
|
|
@@ -44,6 +45,7 @@ const components = {
|
|
|
44
45
|
Carousel,
|
|
45
46
|
Loading,
|
|
46
47
|
Table,
|
|
48
|
+
Backtop,
|
|
47
49
|
...customComponents
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -67,7 +69,7 @@ export const registerSnippets = snippetsModule.registerSnippets
|
|
|
67
69
|
export const getSnippet = snippetsModule.getSnippet
|
|
68
70
|
|
|
69
71
|
// 导出内置组件(按需引入)
|
|
70
|
-
export { Button, Card, Modal, Message, Carousel, Loading, Table, message }
|
|
72
|
+
export { Button, Card, Modal, Message, Carousel, Loading, Table, Backtop, message }
|
|
71
73
|
|
|
72
74
|
// 重新导出自定义组件
|
|
73
75
|
export * from './components/custom/index.js'
|