goview_vue/src/utils/index.ts

25 lines
437 B
TypeScript
Raw Normal View History

import { h } from 'vue';
import { NIcon } from 'naive-ui';
2021-12-10 14:11:49 +08:00
/**
* * ID
2021-12-10 14:11:49 +08:00
* @param { Number } randomLength
*/
export function getUUID(randomLength: number) {
2021-12-10 14:11:49 +08:00
return Number(
Math.random()
.toString()
.substr(2, randomLength) + Date.now()
).toString(36);
}
/**
* * render
*/
export const renderIcon = (icon: any) => {
return () => h(NIcon, null, { default: () => h(icon) });
}
2021-12-10 14:11:49 +08:00