@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): boolean
Check the input value is empty or not, likeundefied
/null
/empty array
.- Parameters
value
:any
The target checked value.
- Return:
boolean
Returntrue
means the value is empty, andfalse
means not.
- Parameters
isMobile(): boolean
Check 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:
boolean
Returntrue
means user is using mobile, andfalse
means not.
- Return:
doStopEvent(e: Event): void
This function will be used to cancel the event which is triggered in Javascript.- Parameters
e
:Event
This 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
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago