@flipit/utils v0.0.30
@flipit/utils
This is a basic function group for @flipit component library. Let's see it as follows agenda:
What is @flipit
It's a component library for Vue, and @flipit/utils is the base for the other extended libraries of @flipit. Presently, it's just a JS function group.
Install & Import
Basically, we don't need to extra install @flipit/utils. It'll be installed when you install the extended libraries. But if you wanna use the JS function group only, you could try as follows:
npm i @flipit/utils -s
After installed, try to import it:
import FlipitFn from '@flipit/utils';
API Documentation
Let's see what FlipitFn provided.
FlipitFn
isEmpty(value: any): booleanCheck the input value is empty or not, likeundefied/null/empty array.- Parameters
value:anyThe target checked value.
- Return:
booleanReturntruemeans the value is empty, andfalsemeans not.
- Parameters
isMobile(): booleanCheck user is using mobile or not. In the extended libraries, there are some UI-components will change their layout to become suitable for mobile.- Return:
booleanReturntruemeans user is using mobile, andfalsemeans not.
- Return:
doStopEvent(e: Event): voidThis function will be used to cancel the event which is triggered in Javascript.- Parameters
e:EventThis parameter is from Javascript event.
- Parameters
<T>toUniqueArray(arr: T[]): T[]This function could help us to make the properties in the specific array be unique. It's a generic function, and you don't need to specify the array type.- Parameters
arr:T[]Input the array which need to be unique.
- Return:
T[]Return the unique result.
- Parameters
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago