UNPKG

vue-login-adder

Version:

a confirm plugin for vue

1 lines 8.81 kB
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["vue-xixixi"]=e():n["vue-xixixi"]=e()}(window,function(){return function(n){var e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=n,t.c=e,t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(r,o,function(e){return n[e]}.bind(null,o));return r},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=8)}([function(n,e,t){var r=t(5);"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);(0,t(3).default)("3b21c7fb",r,!1,{})},function(n,e,t){var r=t(7);"string"==typeof r&&(r=[[n.i,r,""]]),r.locals&&(n.exports=r.locals);(0,t(3).default)("42e2e32b",r,!1,{})},function(n,e,t){"use strict";n.exports=function(n){var e=[];return e.toString=function(){return this.map(function(e){var t=function(n,e){var t=n[1]||"",r=n[3];if(!r)return t;if(e&&"function"==typeof btoa){var o=(a=r,c=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(c),"/*# ".concat(s," */")),i=r.sources.map(function(n){return"/*# sourceURL=".concat(r.sourceRoot).concat(n," */")});return[t].concat(i).concat([o]).join("\n")}var a,c,s;return[t].join("\n")}(e,n);return e[2]?"@media ".concat(e[2],"{").concat(t,"}"):t}).join("")},e.i=function(n,t){"string"==typeof n&&(n=[[null,n,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];null!=i&&(r[i]=!0)}for(var a=0;a<n.length;a++){var c=n[a];null!=c[0]&&r[c[0]]||(t&&!c[2]?c[2]=t:t&&(c[2]="(".concat(c[2],") and (").concat(t,")")),e.push(c))}},e}},function(n,e,t){"use strict";function r(n,e){for(var t=[],r={},o=0;o<e.length;o++){var i=e[o],a=i[0],c={id:n+":"+o,css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(c):t.push(r[a]={id:a,parts:[c]})}return t}t.r(e),t.d(e,"default",function(){return v});var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)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 i={},a=o&&(document.head||document.getElementsByTagName("head")[0]),c=null,s=0,u=!1,f=function(){},l=null,p="data-vue-ssr-id",d="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function v(n,e,t,o){u=t,l=o||{};var a=r(n,e);return h(a),function(e){for(var t=[],o=0;o<a.length;o++){var c=a[o];(s=i[c.id]).refs--,t.push(s)}e?h(a=r(n,e)):a=[];for(o=0;o<t.length;o++){var s;if(0===(s=t[o]).refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete i[s.id]}}}}function h(n){for(var e=0;e<n.length;e++){var t=n[e],r=i[t.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](t.parts[o]);for(;o<t.parts.length;o++)r.parts.push(g(t.parts[o]));r.parts.length>t.parts.length&&(r.parts.length=t.parts.length)}else{var a=[];for(o=0;o<t.parts.length;o++)a.push(g(t.parts[o]));i[t.id]={id:t.id,refs:1,parts:a}}}}function m(){var n=document.createElement("style");return n.type="text/css",a.appendChild(n),n}function g(n){var e,t,r=document.querySelector("style["+p+'~="'+n.id+'"]');if(r){if(u)return f;r.parentNode.removeChild(r)}if(d){var o=s++;r=c||(c=m()),e=x.bind(null,r,o,!1),t=x.bind(null,r,o,!0)}else r=m(),e=function(n,e){var t=e.css,r=e.media,o=e.sourceMap;r&&n.setAttribute("media",r);l.ssrId&&n.setAttribute(p,e.id);o&&(t+="\n/*# sourceURL="+o.sources[0]+" */",t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");if(n.styleSheet)n.styleSheet.cssText=t;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t))}}.bind(null,r),t=function(){r.parentNode.removeChild(r)};return e(n),function(r){if(r){if(r.css===n.css&&r.media===n.media&&r.sourceMap===n.sourceMap)return;e(n=r)}else t()}}var b,_=(b=[],function(n,e){return b[n]=e,b.filter(Boolean).join("\n")});function x(n,e,t,r){var o=t?"":r.css;if(n.styleSheet)n.styleSheet.cssText=_(e,o);else{var i=document.createTextNode(o),a=n.childNodes;a[e]&&n.removeChild(a[e]),a.length?n.insertBefore(i,a[e]):n.appendChild(i)}}},function(n,e,t){"use strict";var r=t(0);t.n(r).a},function(n,e,t){(n.exports=t(2)(!1)).push([n.i,".confirm_wrapper .cover[data-v-b4e9c5c4] {\n position: fixed;\n left: 0;\n top: 0;\n height: 100%;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.3);\n}\n.confirm_wrapper .wrapper[data-v-b4e9c5c4] {\n z-index: 100;\n position: fixed;\n left: 50%;\n top: 20%;\n margin-left: -275px;\n height: 380px;\n width: 550px;\n background-color: #2B3942;\n border-radius: 8px;\n}\n.confirm_wrapper .wrapper .confirm_message[data-v-b4e9c5c4] {\n margin-left: 60px;\n margin-top: 60px;\n font-size: 24px;\n color: #fff;\n}\n.confirm_wrapper .wrapper .button_wrapper[data-v-b4e9c5c4] {\n position: absolute;\n bottom: 40px;\n right: 40px;\n}\n.confirm_wrapper .wrapper .button_wrapper button[data-v-b4e9c5c4] {\n height: 32px;\n width: 84px;\n color: #fff;\n border-radius: 2px;\n cursor: pointer;\n border: none;\n}\n.confirm_wrapper .wrapper .button_wrapper .cancel[data-v-b4e9c5c4] {\n background-color: #22313A;\n margin-right: 20px;\n}\n.confirm_wrapper .wrapper .button_wrapper .confirm[data-v-b4e9c5c4] {\n background-color: #FFCE00;\n}\n",""])},function(n,e,t){"use strict";var r=t(1);t.n(r).a},function(n,e,t){(n.exports=t(2)(!1)).push([n.i,".nono[data-v-2715c15c] {\n color: green;\n width: 200px;\n border-radius: 10px;\n border: 1px solid orange;\n line-height: 100px;\n text-align: center;\n}\n",""])},function(n,e,t){"use strict";t.r(e);var r=function(){var n=this,e=n.$createElement,t=n._self._c||e;return n.showConfirm?t("div",{staticClass:"confirm_wrapper"},[t("div",{staticClass:"cover",on:{click:n.closeDialog}}),n._v(" "),t("div",{staticClass:"wrapper"},[t("div",{staticClass:"confirm_message"},[n._v(n._s(n.confirmText))]),n._v(" "),t("div",{staticClass:"button_wrapper"},[t("button",{staticClass:"cancel",on:{click:n.cancel}},[n._v("取消")]),n._v(" "),t("button",{staticClass:"confirm",on:{click:n.confirm}},[n._v("确定")])])])]):n._e()};r._withStripped=!0;var o={name:"confirm",data:function(){return{showConfirm:!1,confirmText:""}},methods:{giveData:function(n){if(n){var e=n.confirmText;this.confirmText=e,this.showConfirm=!0}},closeDialog:function(){this.showConfirm=!1},cancel:function(){this.callBack(!1),this.closeDialog()},confirm:function(){this.callBack(!0),this.closeDialog()}}};t(4);function i(n,e,t,r,o,i,a,c){var s,u="function"==typeof n?n.options:n;if(e&&(u.render=e,u.staticRenderFns=t,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(s=function(n){(n=n||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(n=__VUE_SSR_CONTEXT__),o&&o.call(this,n),n&&n._registeredComponents&&n._registeredComponents.add(a)},u._ssrRegister=s):o&&(s=c?function(){o.call(this,this.$root.$options.shadowRoot)}:o),s)if(u.functional){u._injectStyles=s;var f=u.render;u.render=function(n,e){return s.call(e),f(n,e)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,s):[s]}return{exports:n,options:u}}var a=i(o,r,[],!1,null,"b4e9c5c4",null);a.options.__file="src/lib/confirm/confirm.vue";var c=a.exports;function s(n){n?f.resolve():f.reject()}var u={},f=null;u.install=function(n,e){var t=n.extend(c);t.prototype.callBack=s;var r=null;n.prototype.$show=function(n){return console.log(11111),r||(r=(new t).$mount(document.createElement("div")),document.body.appendChild(r.$el)),r.giveData(n),new Promise(function(n,e){f={resolve:n,reject:e}})}};var l=u,p=function(){var n=this.$createElement;return(this._self._c||n)("div",{staticClass:"nono"},[this._v("\n 我是nono插件\n")])};p._withStripped=!0;var d={name:"Nono",data:function(){return{}}},v=(t(6),i(d,p,[],!1,null,"2715c15c",null));v.options.__file="src/lib/nono/nono.vue";var h=v.exports,m={install:function(n,e){n.component(h.name,h)}},g=m;t.d(e,"confirm",function(){return l}),t.d(e,"nono",function(){return g})}])});