tdesign-mobile-vue
Version:
tdesign-mobile-vue
33 lines (29 loc) • 917 B
JavaScript
/**
* tdesign v1.7.0
* (c) 2024 TDesign Group
* @license MIT
*/
import { getCurrentInstance, computed, inject } from 'vue';
import isBoolean from 'lodash/isBoolean';
function useFormDisabled(extend) {
var ctx = getCurrentInstance();
var propsDisabled = computed(function () {
return ctx === null || ctx === void 0 ? void 0 : ctx.props.disabled;
});
var _inject = inject("formDisabled", /* @__PURE__ */Object.create(null)),
disabled = _inject.disabled;
return computed(function () {
if (isBoolean(propsDisabled.value)) {
return propsDisabled.value;
}
if (isBoolean(extend === null || extend === void 0 ? void 0 : extend.value)) {
return extend.value;
}
if (isBoolean(disabled === null || disabled === void 0 ? void 0 : disabled.value)) {
return disabled.value;
}
return false;
});
}
export { useFormDisabled };
//# sourceMappingURL=hooks.js.map