@piying/view-vue2-legacy 2.9.5 → 2.9.7

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/index.js CHANGED
@@ -7040,7 +7040,7 @@ var __component__$1 = /* @__PURE__ */ normalizeComponent(
7040
7040
  "9c3edea6"
7041
7041
  );
7042
7042
  const piyingView = __component__$1.exports;
7043
- function useControlValueAccessor(autoChange = true) {
7043
+ function useControlValueAccessor(autoChange = true, optionalBind) {
7044
7044
  const value = shallowRef();
7045
7045
  const disabled = ref$1(false);
7046
7046
  let onChange;
@@ -7070,11 +7070,19 @@ function useControlValueAccessor(autoChange = true) {
7070
7070
  value,
7071
7071
  disabled,
7072
7072
  valueChange: (input) => {
7073
- onChange(input);
7073
+ if (optionalBind) {
7074
+ onChange?.(input);
7075
+ } else {
7076
+ onChange(input);
7077
+ }
7074
7078
  value.value = input;
7075
7079
  },
7076
7080
  touchedChange: () => {
7077
- touched();
7081
+ if (optionalBind) {
7082
+ touched?.();
7083
+ } else {
7084
+ touched();
7085
+ }
7078
7086
  }
7079
7087
  }
7080
7088
  };