@qin-ui/antd-vue-pro 2.0.14 → 2.0.15

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.
Files changed (2) hide show
  1. package/es/form/index.js +10 -3
  2. package/package.json +1 -1
package/es/form/index.js CHANGED
@@ -527,13 +527,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
527
527
  formItemContext.onFieldChange();
528
528
  };
529
529
  const attrs = useAttrs();
530
- const { valueFormatter } = attrs;
531
530
  function getOldValue() {
532
531
  return cloneDeep(getFormData == null ? void 0 : getFormData(props.path));
533
532
  }
534
533
  const value = computed({
535
534
  get() {
536
535
  let val = getFormData == null ? void 0 : getFormData(props.path);
536
+ const { valueFormatter } = groupedAttrs.value;
537
537
  if (typeof valueFormatter === "object" && typeof valueFormatter.get === "function") {
538
538
  val = valueFormatter.get(val);
539
539
  }
@@ -541,6 +541,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
541
541
  },
542
542
  set(val) {
543
543
  let newVal = val;
544
+ const { valueFormatter } = groupedAttrs.value;
544
545
  if (valueFormatter) {
545
546
  if (typeof valueFormatter === "function") {
546
547
  newVal = valueFormatter(val, getOldValue());
@@ -566,9 +567,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
566
567
  { disabled: attrs.disabled ?? parentDisabled.value ?? initProps.disabled },
567
568
  { modelName: attrs.modelName ?? initProps.modelName ?? "value" }
568
569
  );
569
- const { valueFormatter: valueFormatter2, modelName, slots, componentClassName, componentStyle, componentContainer, ...rest } = mergedProps;
570
+ const { valueFormatter, modelName, slots, componentClassName, componentStyle, componentContainer, ...rest } = mergedProps;
570
571
  const bindAttrs = omit(rest, [modelName, `onUpdate:${modelName}`]);
571
- return { attrs: bindAttrs, slots, componentContainer, modelName };
572
+ return {
573
+ attrs: bindAttrs,
574
+ slots,
575
+ componentContainer,
576
+ modelName,
577
+ valueFormatter
578
+ };
572
579
  });
573
580
  const teleportComponent = inject(
574
581
  `${TeleportComponentNamePrefix}${props.path}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qin-ui/antd-vue-pro",
3
- "version": "2.0.14",
3
+ "version": "2.0.15",
4
4
  "description": "二次封装antd vue组件",
5
5
  "type": "module",
6
6
  "module": "es/index.js",