0.0.4 • Published 1 year ago
@lostui/utils v0.0.4
Lost UI Utils
Lost UI Utils is a collection of utility functions for Utility first components based on Vue 3 composition API.
Motivation
In the course of my work, I have created several repetitive utility tools that I thought were worthy of being easily reusable in a separate package.
Install
#npm
npm install @lostui/utils
#pnpm
pnpm add @lostui/utils
UI Utils
Composables
- useDataTable
- useFetchMore
- useLazyLoadingState
- usePagination
- useShowPassword
- useSort
- useScrollToPromise
- useValidation
Components
- FetchMoreObserver
Utils
- SortBy Intl.collator sorting
- nextFrame
- scrollTo
- delay
- animationEnd
Composables
useScrollToPromise
import { useScrollToPromise } from '@lostui/utils'
const scrollTo = useScrollToPromise()
async function goTo() {
await scrollTo('#item-1')
await scrollTo('#item-2')
}
Components
FetchMoreObserver
import { FetchMoreObserver } from '@lostui/utils/components';
<FetchMoreObserver
:options="{ rootMargin: '200px' }"
@intersect="fetchMore"
>
<button @click="more">More</button>
</FetchMoreObserver>