优化
This commit is contained in:
17
monisuo-admin/src/lib/utils.ts
Normal file
17
monisuo-admin/src/lib/utils.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { Updater } from '@tanstack/vue-table'
|
||||
import type { ClassValue } from 'clsx'
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
import { clsx } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
||||
export function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
|
||||
ref.value
|
||||
= typeof updaterOrValue === 'function'
|
||||
? updaterOrValue(ref.value)
|
||||
: updaterOrValue
|
||||
}
|
||||
Reference in New Issue
Block a user