alert.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/ // Check if module is in cache
  8. /******/ if(installedModules[moduleId])
  9. /******/ return installedModules[moduleId].exports;
  10. /******/ // Create a new module (and put it into the cache)
  11. /******/ var module = installedModules[moduleId] = {
  12. /******/ exports: {},
  13. /******/ id: moduleId,
  14. /******/ loaded: false
  15. /******/ };
  16. /******/ // Execute the module function
  17. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  18. /******/ // Flag the module as loaded
  19. /******/ module.loaded = true;
  20. /******/ // Return the exports of the module
  21. /******/ return module.exports;
  22. /******/ }
  23. /******/ // expose the modules object (__webpack_modules__)
  24. /******/ __webpack_require__.m = modules;
  25. /******/ // expose the module cache
  26. /******/ __webpack_require__.c = installedModules;
  27. /******/ // __webpack_public_path__
  28. /******/ __webpack_require__.p = "/dist/";
  29. /******/ // Load entry module and return exports
  30. /******/ return __webpack_require__(0);
  31. /******/ })
  32. /************************************************************************/
  33. /******/ ([
  34. /* 0 */
  35. /***/ function(module, exports, __webpack_require__) {
  36. module.exports = __webpack_require__(1);
  37. /***/ },
  38. /* 1 */
  39. /***/ function(module, exports, __webpack_require__) {
  40. 'use strict';
  41. exports.__esModule = true;
  42. var _main = __webpack_require__(2);
  43. var _main2 = _interopRequireDefault(_main);
  44. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  45. /* istanbul ignore next */
  46. _main2.default.install = function (Vue) {
  47. Vue.component(_main2.default.name, _main2.default);
  48. };
  49. exports.default = _main2.default;
  50. /***/ },
  51. /* 2 */
  52. /***/ function(module, exports, __webpack_require__) {
  53. var Component = __webpack_require__(3)(
  54. /* script */
  55. __webpack_require__(4),
  56. /* template */
  57. __webpack_require__(5),
  58. /* scopeId */
  59. null,
  60. /* cssModules */
  61. null
  62. )
  63. module.exports = Component.exports
  64. /***/ },
  65. /* 3 */
  66. /***/ function(module, exports) {
  67. module.exports = function normalizeComponent (
  68. rawScriptExports,
  69. compiledTemplate,
  70. scopeId,
  71. cssModules
  72. ) {
  73. var esModule
  74. var scriptExports = rawScriptExports = rawScriptExports || {}
  75. // ES6 modules interop
  76. var type = typeof rawScriptExports.default
  77. if (type === 'object' || type === 'function') {
  78. esModule = rawScriptExports
  79. scriptExports = rawScriptExports.default
  80. }
  81. // Vue.extend constructor export interop
  82. var options = typeof scriptExports === 'function'
  83. ? scriptExports.options
  84. : scriptExports
  85. // render functions
  86. if (compiledTemplate) {
  87. options.render = compiledTemplate.render
  88. options.staticRenderFns = compiledTemplate.staticRenderFns
  89. }
  90. // scopedId
  91. if (scopeId) {
  92. options._scopeId = scopeId
  93. }
  94. // inject cssModules
  95. if (cssModules) {
  96. var computed = options.computed || (options.computed = {})
  97. Object.keys(cssModules).forEach(function (key) {
  98. var module = cssModules[key]
  99. computed[key] = function () { return module }
  100. })
  101. }
  102. return {
  103. esModule: esModule,
  104. exports: scriptExports,
  105. options: options
  106. }
  107. }
  108. /***/ },
  109. /* 4 */
  110. /***/ function(module, exports) {
  111. 'use strict';
  112. exports.__esModule = true;
  113. //
  114. //
  115. //
  116. //
  117. //
  118. //
  119. //
  120. //
  121. //
  122. //
  123. //
  124. //
  125. //
  126. //
  127. //
  128. var TYPE_CLASSES_MAP = {
  129. 'success': 'el-icon-circle-check',
  130. 'warning': 'el-icon-warning',
  131. 'error': 'el-icon-circle-cross'
  132. };
  133. exports.default = {
  134. name: 'ElAlert',
  135. props: {
  136. title: {
  137. type: String,
  138. default: '',
  139. required: true
  140. },
  141. description: {
  142. type: String,
  143. default: ''
  144. },
  145. type: {
  146. type: String,
  147. default: 'info'
  148. },
  149. closable: {
  150. type: Boolean,
  151. default: true
  152. },
  153. closeText: {
  154. type: String,
  155. default: ''
  156. },
  157. showIcon: {
  158. type: Boolean,
  159. default: false
  160. }
  161. },
  162. data: function data() {
  163. return {
  164. visible: true
  165. };
  166. },
  167. methods: {
  168. close: function close() {
  169. this.visible = false;
  170. this.$emit('close');
  171. }
  172. },
  173. computed: {
  174. typeClass: function typeClass() {
  175. return 'el-alert--' + this.type;
  176. },
  177. iconClass: function iconClass() {
  178. return TYPE_CLASSES_MAP[this.type] || 'el-icon-information';
  179. },
  180. isBigIcon: function isBigIcon() {
  181. return this.description ? 'is-big' : '';
  182. },
  183. isBoldTitle: function isBoldTitle() {
  184. return this.description ? 'is-bold' : '';
  185. }
  186. }
  187. };
  188. /***/ },
  189. /* 5 */
  190. /***/ function(module, exports) {
  191. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  192. return _c('transition', {
  193. attrs: {
  194. "name": "el-alert-fade"
  195. }
  196. }, [_c('div', {
  197. directives: [{
  198. name: "show",
  199. rawName: "v-show",
  200. value: (_vm.visible),
  201. expression: "visible"
  202. }],
  203. staticClass: "el-alert",
  204. class: [_vm.typeClass]
  205. }, [(_vm.showIcon) ? _c('i', {
  206. staticClass: "el-alert__icon",
  207. class: [_vm.iconClass, _vm.isBigIcon]
  208. }) : _vm._e(), _c('div', {
  209. staticClass: "el-alert__content"
  210. }, [(_vm.title) ? _c('span', {
  211. staticClass: "el-alert__title",
  212. class: [_vm.isBoldTitle]
  213. }, [_vm._v(_vm._s(_vm.title))]) : _vm._e(), _vm._t("default", [(_vm.description) ? _c('p', {
  214. staticClass: "el-alert__description"
  215. }, [_vm._v(_vm._s(_vm.description))]) : _vm._e()]), _c('i', {
  216. directives: [{
  217. name: "show",
  218. rawName: "v-show",
  219. value: (_vm.closable),
  220. expression: "closable"
  221. }],
  222. staticClass: "el-alert__closebtn",
  223. class: {
  224. 'is-customed': _vm.closeText !== '', 'el-icon-close': _vm.closeText === ''
  225. },
  226. on: {
  227. "click": function($event) {
  228. _vm.close()
  229. }
  230. }
  231. }, [_vm._v(_vm._s(_vm.closeText))])], 2)])])
  232. },staticRenderFns: []}
  233. /***/ }
  234. /******/ ]);