h-vue-message
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -1,1 +0,1 @@ | ||
module.exports = require('./lib'); | ||
module.exports = require('./lib') |
@@ -1,24 +0,1 @@ | ||
import msgVue from './index.vue'; | ||
// 定义插件对象 | ||
const AtesMessage = {}; | ||
// vue的install方法,用于定义vue插件 | ||
AtesMessage.install = (Vue, options) => { | ||
const MessageBoxInstance = Vue.extend(msgVue); | ||
// 在Vue的原型上添加实例方法,以全局调用 | ||
Vue.prototype.$message = function (options) { | ||
let currentMsg; | ||
// 实例化vue实例 | ||
currentMsg = new MessageBoxInstance(); | ||
let msgBoxEl = currentMsg.$mount().$el; | ||
document.body.appendChild(msgBoxEl); | ||
if (typeof options === 'string') { | ||
currentMsg.content = options; | ||
} else if (typeof options === 'object') { | ||
Object.assign(currentMsg, options); | ||
} | ||
return currentMsg.showMsg(); | ||
} | ||
}; | ||
export default AtesMessage; | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){var r=n(3);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(6).default)("ff969fa2",r,!1,{})},function(e,t){function n(e){return(n="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})(e)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(e){return n(e)}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},r(t)}e.exports=r},function(e,t,n){"use strict";var r=n(0);n.n(r).a},function(e,t,n){(e.exports=n(4)(!1)).push([e.i,"\n.message[data-v-fdaea6c4] {\r\n\tmin-width: 380px;\r\n\tposition: fixed;\r\n\tleft: 50%;\r\n top: 20px;\r\n\ttransform: translateX(-50%);\r\n\tborder-radius: 0.4em;\r\n\tbackground: #fff;\r\n\tpadding: 15px 15px 15px 20px;\r\n\tborder: 1px solid;\r\n\tz-index: 50001;\r\n animation: fadeIn-data-v-fdaea6c4 .5s;\n}\n@keyframes fadeIn-data-v-fdaea6c4 {\n0% {\r\n top: -50px;\n}\n100% {\r\n top: 20px;\n}\n}\n.message .message-icon[data-v-fdaea6c4] {\r\n margin-right: 10px;\n}\n.message-success[data-v-fdaea6c4] {\r\n\tcolor: #0f644b;\r\n\tbackground-color: #d2f2e9;\r\n\tborder-color: #c0ede0;\n}\n.message-default[data-v-fdaea6c4] {\r\n\tcolor: #336573;\r\n\tbackground-color: #e0f3f8;\r\n\tborder-color: #d3eef6;\n}\n.message-warning[data-v-fdaea6c4] {\r\n\tcolor: #78541f;\r\n\tbackground-color: #faecd8;\r\n\tborder-color: #f8e5c8;\n}\n.message-danger[data-v-fdaea6c4] {\r\n\tcolor: #813838;\r\n\tbackground-color: #fee2e1;\r\n\tborder-color: #fdd6d6;\n}\r\n",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),s=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(s).concat([o]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var s=this[o][0];"number"==typeof s&&(r[s]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),s=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{directives:[{name:"show",rawName:"v-show",value:this.isShowMessageBox,expression:"isShowMessageBox"}],class:"message message-"+this.type},[t("div",[this._v(this._s(this.content||"-"))])])};s._withStripped=!0;var a={props:{content:{type:String,default:"content"},icon:{type:String,default:null},timmer:{type:Number,default:2e3},type:{type:String,default:"default"}},data:function(){return{isShowMessageBox:!1}},methods:{showMsg:function(){this.isShowMessageBox=!0,this.remove()},remove:function(){var e=this;setTimeout(function(){e.destroy()},this.timmer)},destroy:function(){this.$destroy(),document.body.removeChild(this.$el)}}};n(2);var i=function(e,t,n,r,o,s,a,i){var u,f="function"==typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),s&&(f._scopeId="data-v-"+s),a?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=u):o&&(u=i?function(){o.call(this,this.$root.$options.shadowRoot)}:o),u)if(f.functional){f._injectStyles=u;var c=f.render;f.render=function(e,t){return u.call(t),c(e,t)}}else{var d=f.beforeCreate;f.beforeCreate=d?[].concat(d,u):[u]}return{exports:e,options:f}}(a,s,[],!1,null,"fdaea6c4",null);i.options.__file="src/Message.vue";var u=i.exports,f={install:function(e,t){var n=e.extend(u);e.prototype.$message=function(e){var t,r=(t=new n).$mount().$el;return document.body.appendChild(r),"string"==typeof e?t.content=e:"object"===o()(e)&&Object.assign(t,e),t.showMsg()}}};t.default=f},function(e,t,n){"use strict";function r(e,t){for(var n=[],r={},o=0;o<t.length;o++){var s=t[o],a=s[0],i={id:e+":"+o,css:s[1],media:s[2],sourceMap:s[3]};r[a]?r[a].parts.push(i):n.push(r[a]={id:a,parts:[i]})}return n}n.r(t),n.d(t,"default",function(){return m});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 s={},a=o&&(document.head||document.getElementsByTagName("head")[0]),i=null,u=0,f=!1,c=function(){},d=null,l="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function m(e,t,n,o){f=n,d=o||{};var a=r(e,t);return v(a),function(t){for(var n=[],o=0;o<a.length;o++){var i=a[o];(u=s[i.id]).refs--,n.push(u)}t?v(a=r(e,t)):a=[];for(o=0;o<n.length;o++){var u;if(0===(u=n[o]).refs){for(var f=0;f<u.parts.length;f++)u.parts[f]();delete s[u.id]}}}}function v(e){for(var t=0;t<e.length;t++){var n=e[t],r=s[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(y(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o<n.parts.length;o++)a.push(y(n.parts[o]));s[n.id]={id:n.id,refs:1,parts:a}}}}function h(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function y(e){var t,n,r=document.querySelector("style["+l+'~="'+e.id+'"]');if(r){if(f)return c;r.parentNode.removeChild(r)}if(p){var o=u++;r=i||(i=h()),t=x.bind(null,r,o,!1),n=x.bind(null,r,o,!0)}else r=h(),t=function(e,t){var n=t.css,r=t.media,o=t.sourceMap;r&&e.setAttribute("media",r);d.ssrId&&e.setAttribute(l,t.id);o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}var g,b=(g=[],function(e,t){return g[e]=t,g.filter(Boolean).join("\n")});function x(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,o);else{var s=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(s,a[t]):e.appendChild(s)}}}])}); |
{ | ||
"name": "h-vue-message", | ||
"version": "1.0.2", | ||
"description": "message", | ||
"version": "1.0.3", | ||
"description": "vue message", | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"scripts": { | ||
"start": "webpack-dev-server --config ./config/webpack.dev.config.js --open", | ||
"build-example": "webpack-cli --mode production --config config/webpack.dev.config.js", | ||
"build": "webpack-cli --mode production --config config/webpack.prod.config.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"message", | ||
"vue" | ||
"vue", | ||
"message" | ||
], | ||
"author": "musashi", | ||
"license": "ISC" | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@babel/core": "^7.1.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.1.0", | ||
"@babel/preset-env": "^7.1.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-stage-0": "^7.0.0", | ||
"babel-loader": "^8.0.2", | ||
"babel-preset-mobx": "^2.0.0", | ||
"css-loader": "^1.0.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"style-loader": "^0.23.1", | ||
"vue-html-loader": "^1.2.4", | ||
"vue-loader": "^15.4.2", | ||
"webpack": "^4.26.1", | ||
"webpack-cli": "^3.1.2" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0", | ||
"vue": "^2.5.17", | ||
"vue-template-compiler": "^2.5.17" | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
[Example](https://zhu8191553.github.io/h-vue-message/example/) | ||
# Install | ||
@@ -6,3 +7,3 @@ | ||
main.js | ||
``` | ||
```js | ||
import HVueMessage from 'h-vue-message'; | ||
@@ -13,7 +14,12 @@ Vue.use(HVueMessage); | ||
# How To Use | ||
``` | ||
content: String | ||
type: String (success, default, warning, danger) | ||
timmer: Number | ||
this.$message(content, type, timmer) | ||
``` | ||
+ **this.$message(options)** | ||
# options | ||
| params | type | value | default | | ||
|---------- |-------- |---------- |------------- | | ||
| options | object | — | — | | ||
| options.type | string | 'default', 'success', 'error', 'warning' | default | | ||
| options.message | string | — | '-' | | ||
| options.timmer | number | - | 3000 | | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
289267
15
138
24
3
15
1
+ Added@babel/runtime@^7.0.0
+ Addedvue@^2.5.17
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.2(transitive)
+ Added@babel/runtime@7.26.0(transitive)
+ Added@babel/types@7.26.0(transitive)
+ Added@vue/compiler-sfc@2.7.16(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addedde-indent@1.0.2(transitive)
+ Addedhe@1.2.0(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.4.49(transitive)
+ Addedprettier@2.8.8(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedvue@2.7.16(transitive)
+ Addedvue-template-compiler@2.7.16(transitive)