col.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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__(71);
  37. /***/ },
  38. /***/ 71:
  39. /***/ function(module, exports, __webpack_require__) {
  40. 'use strict';
  41. exports.__esModule = true;
  42. var _col = __webpack_require__(72);
  43. var _col2 = _interopRequireDefault(_col);
  44. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  45. /* istanbul ignore next */
  46. _col2.default.install = function (Vue) {
  47. Vue.component(_col2.default.name, _col2.default);
  48. };
  49. exports.default = _col2.default;
  50. /***/ },
  51. /***/ 72:
  52. /***/ function(module, exports) {
  53. 'use strict';
  54. exports.__esModule = true;
  55. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  56. exports.default = {
  57. name: 'ElCol',
  58. props: {
  59. span: {
  60. type: Number,
  61. default: 24
  62. },
  63. offset: Number,
  64. pull: Number,
  65. push: Number,
  66. xs: [Number, Object],
  67. sm: [Number, Object],
  68. md: [Number, Object],
  69. lg: [Number, Object]
  70. },
  71. computed: {
  72. gutter: function gutter() {
  73. return this.$parent.gutter;
  74. },
  75. style: function style() {
  76. var ret = {};
  77. if (this.gutter) {
  78. ret.paddingLeft = this.gutter / 2 + 'px';
  79. ret.paddingRight = ret.paddingLeft;
  80. }
  81. return ret;
  82. }
  83. },
  84. render: function render(h) {
  85. var _this = this;
  86. var style = this.style;
  87. var classList = [];
  88. ['span', 'offset', 'pull', 'push'].forEach(function (prop) {
  89. if (_this[prop]) {
  90. classList.push(prop !== 'span' ? 'el-col-' + prop + '-' + _this[prop] : 'el-col-' + _this[prop]);
  91. }
  92. });
  93. ['xs', 'sm', 'md', 'lg'].forEach(function (size) {
  94. if (typeof _this[size] === 'number') {
  95. classList.push('el-col-' + size + '-' + _this[size]);
  96. } else if (_typeof(_this[size]) === 'object') {
  97. (function () {
  98. var props = _this[size];
  99. Object.keys(props).forEach(function (prop) {
  100. classList.push(prop !== 'span' ? 'el-col-' + size + '-' + prop + '-' + props[prop] : 'el-col-' + size + '-' + props[prop]);
  101. });
  102. })();
  103. }
  104. });
  105. return h(
  106. 'div',
  107. {
  108. 'class': ['el-col', classList],
  109. style: style },
  110. [this.$slots.default]
  111. );
  112. }
  113. };
  114. /***/ }
  115. /******/ });