throttle-box
Version:
throttle-box节流盒子
2 lines (1 loc) • 2.45 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).index=t(e.Vue)}(this,(function(e){"use strict";var t=document.createElement("style");t.textContent=".throttleBox[data-v-06812a85]{display:inline-flex;justify-content:center;align-items:center;line-height:1;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none}.throttleBox[data-v-06812a85] .el-loading-mask{--el-loading-spinner-size: 20px}\n",document.head.appendChild(t);const n={name:"ButtonThrottle",props:{modelValue:Boolean,svg:{type:String,default:'<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-ea893728=""><path fill="currentColor" d="M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"></path></svg>'}},data:()=>({}),watch:{modelValue:{handler(){this.modelValue},immediate:!0}},created(){},methods:{}},o=["element-loading-svg"];const a=((e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n})(n,[["render",function(t,n,a,l,i,r){const s=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("span",{class:"throttleBox",onClick:n[0]||(n[0]=e.withModifiers(((...e)=>t.throttle&&t.throttle(...e)),["stop"])),"element-loading-svg":t.svg},[e.renderSlot(t.$slots,"default",{},void 0,!0)],8,o)),[[s,t.modelValue]])}],["__scopeId","data-v-06812a85"]]),l=[a];return{install:function(e){l.map((t=>{e.component(t.name,t)}))},ThrottleBox:a}}));