vuealertdemo
Version:
Popover test package upload NPM
2 lines • 10.7 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("vueZsdAlertwin",[],t):"object"==typeof exports?exports.vueZsdAlertwin=t():e.vueZsdAlertwin=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=1)}([function(e,t,n){"use strict";t.a={name:"vue-zsd-alertwin",data:function(){return{btnTpye:"btn1",btnText:["确定"],title:"提示框",tipsText:"这是提示",colorType:"#009bff",fonSize:"14",fontColor:"#666",icon:!0,iconsrc:"",showType:"box-scale",maskLayer:!0,diaphaneity:"rgba(255,255,255,.2)",callback:function(e){console.log("index="+e)}}},methods:{closeAlertWin:function(){var e=document.getElementById("alertBoxWin");e.parentNode.removeChild(e)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a={};a.install=function(e,t){var n={btnTpye:"btn1",btnText:["确定"],tipsText:"这是提示",colorType:"#009bff",diaphaneity:"rgba(255,255,255,.2)",maskLayer:!0,fonSize:"14",fontColor:"#666",icon:!0,iconsrc:"",showType:"box-scale",callback:function(e){}};for(var a in t)n[a]=t[a];e.prototype.$alert=function(t){if("object"==(void 0===t?"undefined":r(t)))for(var a in t)n[a]=t[a];var i=e.extend(o.a),s=(new i).$mount(document.createElement("div"));s.btnTpye=n.btnTpye,s.btnText=n.btnText,s.tipsText=n.tipsText,s.fonSize=n.fonSize,s.fontColor=n.fontColor,s.iconsrc=n.iconsrc,s.icon=n.icon,s.showType=n.showType,s.colorType=n.colorType,s.diaphaneity=n.diaphaneity,s.maskLayer=n.maskLayer;var l=document.getElementById("alertBoxWin");null!=l&&document.body.removeChild(l),document.body.appendChild(s.$el),setTimeout(function(){for(var e=document.querySelectorAll("."+n.btnTpye),t=0;t<e.length;t++)!function(t){var o=e[t];o.addEventListener("click",function(){n.callback(t),document.body.removeChild(s.$el)}),"btn2"==n.btnTpye&&(o.addEventListener("mouseover",function(){o.style.background=n.colorType,o.style.color="#fff"}),o.addEventListener("mouseout",function(){o.style.background="#fff",o.style.color="#666"}))}(t)},400)},e.prototype.$alert.show=function(t){e.prototype.$alert(t)}},"undefined"!=typeof window&&window.Vue&&window.Vue.use(a),t.default=a},function(e,t,n){"use strict";function o(e){n(3)}var r=n(0),a=n(9),i=n(8),s=o,l=i(r.a,a.a,!1,s,"data-v-03fbf961",null);t.a=l.exports},function(e,t,n){var o=n(4);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(6)("6f3c3e7d",o,!0,{})},function(e,t,n){t=e.exports=n(5)(!1),t.push([e.i,"[data-v-03fbf961]{margin:0;padding:0}.alert-box[data-v-03fbf961]{width:100%;height:100%;position:fixed;top:0;left:0;display:flex;align-items:center;justify-content:center;z-index:99999}.alert-box .alert-bg[data-v-03fbf961]{position:absolute;width:100%;height:100%;z-index:2;background-color:rgba(0,0,0,.2)}.alert-box .alert-cont[data-v-03fbf961]{z-index:3;width:260px;height:auto;background-color:#fff;border-radius:5px;overflow:hidden;border:1px solid #eee}.alert-box .alert-cont .alert-p[data-v-03fbf961]{position:relative;width:100%;height:36px;line-height:36px;text-align:left;text-indent:10px;background-color:#009bff;color:#fff;font-size:14px}.alert-box .alert-cont .alert-p a[data-v-03fbf961]{display:block;position:absolute;right:0;top:0;width:30px;height:30px;text-indent:0;text-align:center;font-size:20px;cursor:pointer}.alert-box .alert-cont .alert-p a b[data-v-03fbf961]{display:block;transition:All .4s linear;transform-origin:center center;font-weight:500}.alert-box .alert-cont .alert-p a:hover b[data-v-03fbf961]{color:#e80000;transform:rotate(90deg)}.alert-box .alert-cont .alert-tips[data-v-03fbf961]{padding:10px;min-height:60px;font-size:14px;display:flex;align-items:center;justify-content:center}.alert-box .alert-cont .alert-tips img[data-v-03fbf961]{max-width:40px;padding:0 8px}.alert-box .alert-cont .alert-btn[data-v-03fbf961]{width:100%;height:34px;white-space:nowrap}.alert-box .alert-cont .alert-btn a[data-v-03fbf961]{cursor:pointer}.alert-box .alert-cont .alert-btn a.btn1[data-v-03fbf961]{display:block;width:100%;height:34px;line-height:34px;background-color:#009bff;color:#fff;font-size:14px;text-align:center}.alert-box .alert-cont .alert-btn a.btn2[data-v-03fbf961]{display:inline-block;width:50%;border-right:1px solid #eee;border-top:1px solid #eee;line-height:34px;font-size:14px;text-align:center;color:#666}.box-scale[data-v-03fbf961]{animation:scale_1-data-v-03fbf961 .8s linear}@keyframes scale_1-data-v-03fbf961{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.box-translateT[data-v-03fbf961]{animation:translateT_1-data-v-03fbf961 .8s linear}@keyframes translateT_1-data-v-03fbf961{0%{transform:translateY(-50px);opacity:0}to{transform:translateY(0);opacity:1}}",""])},function(e,t){function n(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var a=o(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([a]).join("\n")}return[n].join("\n")}function o(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var o=n(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var a=this[r][0];"number"==typeof a&&(o[a]=!0)}for(r=0;r<e.length;r++){var i=e[r];"number"==typeof i[0]&&o[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},function(e,t,n){function o(e){for(var t=0;t<e.length;t++){var n=e[t],o=f[n.id];if(o){o.refs++;for(var r=0;r<o.parts.length;r++)o.parts[r](n.parts[r]);for(;r<n.parts.length;r++)o.parts.push(a(n.parts[r]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{for(var i=[],r=0;r<n.parts.length;r++)i.push(a(n.parts[r]));f[n.id]={id:n.id,refs:1,parts:i}}}}function r(){var e=document.createElement("style");return e.type="text/css",d.appendChild(e),e}function a(e){var t,n,o=document.querySelector("style["+y+'~="'+e.id+'"]');if(o){if(b)return v;o.parentNode.removeChild(o)}if(x){var a=p++;o=u||(u=r()),t=i.bind(null,o,a,!1),n=i.bind(null,o,a,!0)}else o=r(),t=s.bind(null,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}function i(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=m(t,r);else{var a=document.createTextNode(r),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function s(e,t){var n=t.css,o=t.media,r=t.sourceMap;if(o&&e.setAttribute("media",o),h.ssrId&&e.setAttribute(y,t.id),r&&(n+="\n/*# sourceURL="+r.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=n(7),f={},d=l&&(document.head||document.getElementsByTagName("head")[0]),u=null,p=0,b=!1,v=function(){},h=null,y="data-vue-ssr-id",x="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n,r){b=n,h=r||{};var a=c(e,t);return o(a),function(t){for(var n=[],r=0;r<a.length;r++){var i=a[r],s=f[i.id];s.refs--,n.push(s)}t?(a=c(e,t),o(a)):a=[];for(var r=0;r<n.length;r++){var s=n[r];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete f[s.id]}}}};var m=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t){e.exports=function(e,t){for(var n=[],o={},r=0;r<t.length;r++){var a=t[r],i=a[0],s=a[1],l=a[2],c=a[3],f={id:e+":"+r,css:s,media:l,sourceMap:c};o[i]?o[i].parts.push(f):n.push(o[i]={id:i,parts:[f]})}return n}},function(e,t){e.exports=function(e,t,n,o,r,a){var i,s=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(i=e,s=e.default);var c="function"==typeof s?s.options:s;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId=r);var f;if(a?(f=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=f):o&&(f=o),f){var d=c.functional,u=d?c.render:c.beforeCreate;d?(c._injectStyles=f,c.render=function(e,t){return f.call(t),u(e,t)}):c.beforeCreate=u?[].concat(u,f):[f]}return{esModule:i,exports:s,options:c}}},function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"alert-box",attrs:{id:"alertBoxWin"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.maskLayer,expression:"maskLayer"}],staticClass:"alert-bg",style:"background-color:"+e.diaphaneity}),e._v(" "),n("div",{class:"alert-cont "+e.showType},[n("p",{staticClass:"alert-p",style:"background-color:"+e.colorType+";"},[e._v(e._s(e.title)),n("a",{on:{click:e.closeAlertWin}},[n("b",[e._v("×")])])]),e._v(" "),n("div",{staticClass:"alert-tips",style:"font-size:"+e.fonSize+"px;color:"+e.fontColor},[n("img",{directives:[{name:"show",rawName:"v-show",value:e.icon,expression:"icon"}],attrs:{src:e.iconsrc}}),e._v("\n "+e._s(e.tipsText)+"\n\t\t\t")]),e._v(" "),n("div",{staticClass:"alert-btn"},[1==e.btnText.length?e._l(e.btnText,function(t){return n("a",{class:e.btnTpye,style:"background-color:"+e.colorType+";"},[e._v(e._s(t))])}):e._l(e.btnText,function(t){return n("a",{class:e.btnTpye},[e._v(e._s(t))])})],2)])])},r=[],a={render:o,staticRenderFns:r};t.a=a}])});
//# sourceMappingURL=vue-zsd-alertwin.min.js.map