UNPKG

tdesign-vue-next

Version:
34 lines (30 loc) 1.17 kB
/** * tdesign v1.11.5 * (c) 2025 tdesign * @license MIT */ import { getCurrentInstance, computed, inject } from 'vue'; function useFormDisabled(extend) { var ctx = getCurrentInstance(); var propsDisabled = computed(function () { return ctx.props.disabled; }); var _inject = inject("formDisabled", /* @__PURE__ */Object.create(null)), disabled = _inject.disabled; return computed(function () { return propsDisabled.value || (disabled === null || disabled === void 0 ? void 0 : disabled.value) || (extend === null || extend === void 0 ? void 0 : extend.value) || false; }); } function useFormReadonly(extend) { var ctx = getCurrentInstance(); var propsReadonly = computed(function () { return ctx.props.readonly; }); var _inject2 = inject("formReadonly", /* @__PURE__ */Object.create(null)), readonly = _inject2.readonly; return computed(function () { return propsReadonly.value || (readonly === null || readonly === void 0 ? void 0 : readonly.value) || (extend === null || extend === void 0 ? void 0 : extend.value) || false; }); } export { useFormDisabled, useFormReadonly }; //# sourceMappingURL=index.js.map