dpzvc-ui 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dpzvc.esm.js CHANGED
@@ -4714,49 +4714,56 @@ var component = (0,_node_modules_vue_loader_lib_runtime_componentNormalizer_js__
4714
4714
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4715
4715
  /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
4716
4716
  /* harmony export */ });
4717
- /* harmony import */ var _messageGroup_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4998);
4717
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4467);
4718
4718
  /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5286);
4719
- /* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1819);
4719
+ /* harmony import */ var _messageGroup_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4998);
4720
+ /* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1819);
4721
+
4722
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4723
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4720
4724
  /**
4721
- * Created by admin on 2017/5/8.
4725
+ * messageGroup.js
4726
+ * 兼容 Vue 2.7 runtime-only 构建
4722
4727
  */
4723
4728
 
4724
4729
 
4730
+ // 你的 Vue 组件
4725
4731
 
4726
-
4727
- _messageGroup_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.newInstance = function (props) {
4728
- var _props = props || {};
4729
- var _prop = '';
4730
- Object.keys(_props).forEach(function (prop) {
4731
- _prop += ' :' + (0,_utils_util__WEBPACK_IMPORTED_MODULE_2__/* .camelcaseToHyphen */ .Ad)(prop) + '=' + prop;
4732
- });
4732
+ _messageGroup_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.newInstance = function () {
4733
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4733
4734
  var div = document.createElement('div');
4734
4735
  document.body.appendChild(div);
4735
- var message = new vue__WEBPACK_IMPORTED_MODULE_1__["default"]({
4736
- el: div,
4737
- data: _props,
4738
- template: "<Message-group ".concat(_prop, " ></Message-group>"),
4739
- components: {
4740
- MessageGroup: _messageGroup_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A
4736
+
4737
+ // 使用 render 函数代替 template,兼容 runtime-only
4738
+ var messageVm = new vue__WEBPACK_IMPORTED_MODULE_1__["default"]({
4739
+ data: function data() {
4740
+ return _objectSpread({}, props);
4741
+ },
4742
+ render: function render(h) {
4743
+ return h(_messageGroup_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A, {
4744
+ props: props
4745
+ });
4741
4746
  }
4742
- }).$children[0];
4747
+ }).$mount(div);
4748
+ var instance = messageVm.$children[0]; // 确保实例存在
4749
+
4743
4750
  return {
4744
- add: function add(props) {
4745
- message.add(props);
4751
+ add: function add(options) {
4752
+ if (instance) instance.add(options);
4746
4753
  },
4747
- remove: function remove(props) {
4748
- message.remove(props);
4754
+ remove: function remove(options) {
4755
+ if (instance) instance.remove(options);
4749
4756
  },
4750
- component: message,
4757
+ component: instance,
4751
4758
  destroy: function destroy() {
4752
- message.closeAll();
4759
+ if (instance) instance.closeAll();
4753
4760
  setTimeout(function () {
4754
- document.body.removeChild(document.getElementsByClassName('dpzvc-message')[0].parentElement);
4761
+ if (div.parentNode) div.parentNode.removeChild(div);
4755
4762
  }, 500);
4756
4763
  }
4757
4764
  };
4758
4765
  };
4759
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_messageGroup_vue__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);
4766
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_messageGroup_vue__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A);
4760
4767
 
4761
4768
  /***/ },
4762
4769
 
@@ -12222,7 +12229,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `
12222
12229
  justify-content: center;
12223
12230
  flex-direction: column;
12224
12231
  }
12225
- `, "",{"version":3,"sources":["webpack://./radiobox-group.vue"],"names":[],"mappings":";AA0EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from \"../../utils/util\"\n const prefixCls = 'dpzvc-radioBoxGroup'\n export default {\n name:'radioBoxGroup',\n props:{\n value:{\n type:[String,Boolean,Number]\n },\n vertical:{\n type:Boolean,\n default:false\n }\n },\n mounted(){\n this.updateModel()\n },\n data(){\n return {\n currentValue:this.value,\n children:findComponentsDownward(this,'radioBox')\n }\n },\n computed:{\n classes(){\n return [\n `${prefixCls}`,\n {\n [`${prefixCls}-vertical`]:this.vertical\n }\n ]\n\n }\n },\n methods:{\n change(data){\n this.currentValue = data.value;\n this.updateModel();\n this.$emit('input',data.value);\n this.$emit('on-change',data.value);\n this.$emit('on-form-change',data.value)\n },\n updateModel(){\n let value = this.value;\n this.children = findComponentsDownward(this,'radioBox');\n this.children.forEach((child)=>{\n child.model = value == child.label;\n child.isGroup = true;\n\n })\n }\n },\n watch:{\n value(){\n this.updateModel();\n },\n }\n }\n</script>\n\n<style scoped >\n .dpzvc-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
12232
+ `, "",{"version":3,"sources":["webpack://./src/components/radioBox/radiobox-group.vue"],"names":[],"mappings":";AA0EA;IACA,aAAA;IACA,uBAAA;IACA,sBAAA;AACA","sourcesContent":["<template>\n <div :class=\"classes\">\n <slot></slot>\n </div>\n</template>\n\n<script>\n\n import {findComponentsDownward} from \"../../utils/util\"\n const prefixCls = 'dpzvc-radioBoxGroup'\n export default {\n name:'radioBoxGroup',\n props:{\n value:{\n type:[String,Boolean,Number]\n },\n vertical:{\n type:Boolean,\n default:false\n }\n },\n mounted(){\n this.updateModel()\n },\n data(){\n return {\n currentValue:this.value,\n children:findComponentsDownward(this,'radioBox')\n }\n },\n computed:{\n classes(){\n return [\n `${prefixCls}`,\n {\n [`${prefixCls}-vertical`]:this.vertical\n }\n ]\n\n }\n },\n methods:{\n change(data){\n this.currentValue = data.value;\n this.updateModel();\n this.$emit('input',data.value);\n this.$emit('on-change',data.value);\n this.$emit('on-form-change',data.value)\n },\n updateModel(){\n let value = this.value;\n this.children = findComponentsDownward(this,'radioBox');\n this.children.forEach((child)=>{\n child.model = value == child.label;\n child.isGroup = true;\n\n })\n }\n },\n watch:{\n value(){\n this.updateModel();\n },\n }\n }\n</script>\n\n<style scoped >\n .dpzvc-radioBoxGroup-vertical {\n display: flex;\n justify-content: center;\n flex-direction: column;\n }\n</style>"],"sourceRoot":""}]);
12226
12233
  // Exports
12227
12234
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
12228
12235