lcl-test-ui
Version:
一个vue3 组件库 首先你的项目中必须需要引入 element plus
2 lines (1 loc) • 4.91 kB
JavaScript
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n["lcl-test-ui"]={},n.vue))})(this,function(n,e){"use strict";const T="",d=(t,c)=>{const o=t.__vccOpts||t;for(const[l,a]of c)o[l]=a;return o},f={class:"my-button"},h=e.defineComponent({name:"lclButton"}),u=d(Object.assign(h,{props:{type:{type:String,default:"default"}},setup(t){const c=t,o=e.computed(()=>["lcl-button",`lcl-button-${c.type}`]);return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(o))},[e.createElementVNode("button",f,[e.renderSlot(l.$slots,"default",{},void 0,!0)])],2))}}),[["__scopeId","data-v-b7918169"]]),O="",y=["value","placeholder"],g=e.defineComponent({name:"lclInput"}),p=d(Object.assign(g,{props:{placeholder:{type:String,default:"placeholder"},modelValue:{type:String||Number,default:"placeholder"}},emits:["update:modelValue"],setup(t,{emit:c}){const o=l=>{c("update:modelValue",l.target.value)};return(l,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("input",{class:"lcl-input",type:"text",value:t.modelValue,placeholder:t.placeholder,onInput:o},null,40,y)]))}}),[["__scopeId","data-v-f6d98ac9"]]),P="",b={name:"lclMessage",props:{type:{type:String,default:"success"},str:{type:String,default:"登陆成功"}},setup(){const t={warning:{color:"#faad14"},error:{color:"#F56C6C"},success:{color:"#52c41a"},info:{color:"#1890ff"}},c=e.ref(!1);return e.onMounted(()=>{c.value=!0}),{style:t,visible:c}}},s=t=>(e.pushScopeId("data-v-a983a60b"),t=t(),e.popScopeId(),t),B={class:"lcl-message-box"},k={key:0,focusable:"false",class:"","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},V=[s(()=>e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"},null,-1))],w={key:1,focusable:"false",class:"","data-icon":"exclamation-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},C=[s(()=>e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"},null,-1))],E={key:2,focusable:"false",class:"","data-icon":"close-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},S=[s(()=>e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"},null,-1))],x={key:3,focusable:"false",class:"","data-icon":"info-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",viewBox:"64 64 896 896"},N=[s(()=>e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"},null,-1))],z={class:"text"};function M(t,c,o,l,a,v){return e.openBlock(),e.createElementBlock("div",B,[e.withDirectives(e.createElementVNode("div",{class:"lcl-message",style:e.normalizeStyle(l.style[o.type])},[o.type==="success"?(e.openBlock(),e.createElementBlock("svg",k,V)):e.createCommentVNode("",!0),o.type==="warning"?(e.openBlock(),e.createElementBlock("svg",w,C)):e.createCommentVNode("",!0),o.type==="error"?(e.openBlock(),e.createElementBlock("svg",E,S)):e.createCommentVNode("",!0),o.type==="info"?(e.openBlock(),e.createElementBlock("svg",x,N)):e.createCommentVNode("",!0),e.createElementVNode("span",z,e.toDisplayString(o.str),1)],4),[[e.vShow,l.visible]])])}const I=d(b,[["render",M],["__scopeId","data-v-a983a60b"]]),i=typeof document<"u"&&typeof document.createElement<"u"?document.createElement("div"):"";let r=null;const _=({str:t,type:c})=>{document.body.appendChild(i);const o=e.createVNode(I,{str:t,type:c});e.render(o,i),r&&clearTimeout(r),r=setTimeout(()=>{e.render(null,i)},5e6)},$=[u,p,_],m=function(t){$.forEach(c=>{t.component(c.name,c)}),t.config.globalProperties.$lclMessage=_,typeof window<"u"&&window.Vue&&m(window.Vue)},L={install:m};n.Message=_,n.default=L,n.install=m,n.lclButton=u,n.lclInput=p,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});