keep-vue
Version:
Keep Vue is an open-source component library built on top of Vue3 and Tailwind CSS. It offers a collection of pre-designed UI components and styles that you can easily integrate into your web applications.
15 lines (14 loc) • 502 B
JavaScript
import { createInjectionState } from "@vueuse/core";
const uploadStoreKey = "upload-store";
const [useProvideUpload, useInjectUpload] = createInjectionState(({ options, horizontal }) => {
return { options, horizontal };
}, {
injectionKey: uploadStoreKey,
});
function useUpload() {
const UploadState = useInjectUpload();
if (!UploadState)
throw new Error("useUpload must be used within a <Upload /> Component");
return UploadState;
}
export { useProvideUpload, useUpload };