UNPKG

vue-confirm

Version:

一个带消息的和确定取消对话框 Confirm cancel dialog box

1 lines 9.49 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("vue"));else if("function"==typeof define&&define.amd)define(["vue"],t);else{var n=t("object"==typeof exports?require("vue"):e.vue);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,function(e){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="/",t(t.s=0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=o(r),a=n(2),s=o(a),p=void 0,u=i.default.extend(s.default),c=function(){p=new u({el:document.createElement("div")}),document.body.appendChild(p.$el)},l=function(e){return c(),p.content=e,new Promise(function(e,t){p.show=!0;var n=Array.prototype.slice.call(document.querySelectorAll("input"));document.getElementsByTagName("body")[0].style.overflow="hidden",n.forEach(function(e){e.blur()});var o=p.success,r=p.cancel;p.success=function(){document.getElementsByTagName("body")[0].style.overflow="auto",o(),e("ok")},p.cancel=function(){r(),document.getElementsByTagName("body")[0].style.overflow="auto",t("cancel")}})};t.default={install:function(e){e.prototype.$confirm=l}}},function(t,n){t.exports=e},function(e,t,n){n(3);var o=n(8)(n(9),n(10),null,null);e.exports=o.exports},function(e,t,n){var o=n(4);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals),n(6)("1757fa5b",o,!0)},function(e,t,n){t=e.exports=n(5)(void 0),t.push([e.i,'*{margin:0;padding:0}.wh{top:0;height:100%;width:100%;background:rgba(0,0,0,.4);z-index:998;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Helvetica Neue,STHeiti,Microsoft Yahei,Tahoma,Simsun,sans-serif;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(255,255,255,0)}.wh,.wh-popup{position:fixed}.wh-popup{z-index:999;top:50%;left:50%;overflow:hidden;width:270px;-webkit-transform:translate3d(-50%,-50%,0) scale(1.185);text-align:center;color:#000;border-radius:13px}.wh-popup.wh-popup-in{display:block;opacity:1}.wh-popup.wh-popup-in,.wh-popup.wh-popup-out{-webkit-transform:translate3d(-50%,-50%,0) scale(1);transform:translate3d(-50%,-50%,0) scale(1)}.wh-popup.wh-popup-out{opacity:0}.wh-popup-inner{position:relative;padding:15px;border-radius:13px 13px 0 0;background:hsla(0,0%,100%,.95)}.wh-popup-inner:after{position:absolute;z-index:15;top:auto;right:auto;bottom:0;left:0;display:block;width:100%;height:1px;content:"";-webkit-transform:scaleY(.5);transform:scaleY(.5);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;background-color:rgba(0,0,0,.2)}.wh-popup-title{font-size:18px;font-weight:500;text-align:center}.wh-popup-title+.wh-popup-text{font-family:inherit;font-size:14px;margin:5px 0 0}.wh-popup-buttons{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;height:44px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.wh-popup-button{font-size:17px;line-height:44px;position:relative;display:block;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:44px;padding:0 5px;text-align:center;white-space:nowrap;text-overflow:ellipsis;color:#3478f6;background:hsla(0,0%,100%,.95);letter-spacing:.5px;cursor:pointer}.wh-popup-button:after{position:absolute;z-index:15;top:0;right:0;bottom:auto;left:auto;display:block;width:1px;height:100%;content:"";-webkit-transform:scaleX(.5);transform:scaleX(.5);-webkit-transform-origin:100% 50%;transform-origin:100% 50%;background-color:rgba(0,0,0,.2)}.wh-popup-button:first-child{border-radius:0 0 0 13px;border-right:1px solid hsla(0,0%,100%,.95)}.wh-popup-button:first-child:last-child{border-radius:0 0 13px 13px}.wh-popup-button:last-child{border-radius:0 0 13px 0}.wh-popup-button-bold{font-weight:600}.wh-popup-button:last-child:after{display:none}.wh-popup-input{width:100%;margin-top:12px}.wh-popup-input input{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;-webkit-appearance:none;width:90%;height:26px;margin:0 auto;padding:0 5px;font-size:14px;background:#fff;border:.5px solid rgba(0,0,0,.2);border-radius:0}.wh-fade-alert-enter{opacity:0}.wh-fade-alert-enter .wh-popup{-webkit-transform:translate3d(-50%,-50%,0) scale(1.185);transform:translate3d(-50%,-50%,0) scale(1.185)}.wh-fade-alert-enter-active,.wh-fade-alert-enter-active .wh-popup,.wh-fade-alert-leave-active,.wh-fade-alert-leave-active .wh-popup{-webkit-transition:all .4s;transition:all .4s}.wh-fade-alert-leave-active{opacity:0}',""])},function(e,t){function n(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=o(r);return[n].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).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 i=this[r][0];"number"==typeof i&&(o[i]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&o[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){function o(e){for(var t=0;t<e.length;t++){var n=e[t],o=c[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(i(n.parts[r]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{for(var a=[],r=0;r<n.parts.length;r++)a.push(i(n.parts[r]));c[n.id]={id:n.id,refs:1,parts:a}}}}function r(){var e=document.createElement("style");return e.type="text/css",l.appendChild(e),e}function i(e){var t,n,o=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(o){if(h)return b;o.parentNode.removeChild(o)}if(v){var i=f++;o=d||(d=r()),t=a.bind(null,o,i,!1),n=a.bind(null,o,i,!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 a(e,t,n,o){var r=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var i=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function s(e,t){var n=t.css,o=t.media,r=t.sourceMap;if(o&&e.setAttribute("media",o),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 p="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!p)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 u=n(7),c={},l=p&&(document.head||document.getElementsByTagName("head")[0]),d=null,f=0,h=!1,b=function(){},v="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n){h=n;var r=u(e,t);return o(r),function(t){for(var n=[],i=0;i<r.length;i++){var a=r[i],s=c[a.id];s.refs--,n.push(s)}t?(r=u(e,t),o(r)):r=[];for(var i=0;i<n.length;i++){var s=n[i];if(0===s.refs){for(var p=0;p<s.parts.length;p++)s.parts[p]();delete c[s.id]}}}};var w=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 i=t[r],a=i[0],s=i[1],p=i[2],u=i[3],c={id:e+":"+r,css:s,media:p,sourceMap:u};o[a]?o[a].parts.push(c):n.push(o[a]={id:a,parts:[c]})}return n}},function(e,t){e.exports=function(e,t,n,o){var r,i=e=e||{},a=typeof e.default;"object"!==a&&"function"!==a||(r=e,i=e.default);var s="function"==typeof i?i.options:i;if(t&&(s.render=t.render,s.staticRenderFns=t.staticRenderFns),n&&(s._scopeId=n),o){var p=Object.create(s.computed||null);Object.keys(o).forEach(function(e){var t=o[e];p[e]=function(){return t}}),s.computed=p}return{esModule:r,exports:i,options:s}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={data:function(){return{show:!1,content:""}},computed:{},mounted:function(){},methods:{success:function(){this.show=!1},cancel:function(){this.show=!1}}}},function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"wh-fade-alert"}},[e.show?n("div",{staticClass:"wh"},[n("div",{staticClass:"wh-popup wh-popup-in"},[n("div",{staticClass:"wh-popup-inner"},[n("div",{staticClass:"wh-popup-title"},[e._v("提示")]),e._v(" "),n("div",{staticClass:"wh-popup-text"},[e._v(e._s(e.content))])]),e._v(" "),n("div",{staticClass:"wh-popup-buttons"},[n("span",{staticClass:"wh-popup-button",on:{click:e.cancel}},[e._v("取消")]),e._v(" "),n("span",{staticClass:"wh-popup-button",on:{click:e.success}},[e._v("确定")])])])]):e._e()])},staticRenderFns:[]}}])});