@cataract6545/tmui
Version:
tm-vuetify是一个新势力由主题驱动的UI组件库,相比其它优势大,组件全,设计趋势紧跟未来。具有主题生成,主题实时切换,暗黑实时切换,lottie动画,图表等新颖功能,tmui TMUI
19 lines (18 loc) • 579 B
text/typescript
/**随机获取图片 */
export const useGetImage = function () {
/**随机取得一张图片 */
function getRandomImage(width:number=500) {
return `https://store.tmui.design/api_v2/public/random_picture?random=${(Math.random() * 100).toFixed(0)}&width=${width}`
}
/**获取图片列表,row为数量,每次的最大值为14 */
function getImageList(row: number,width:number=500) {
if (row >= 14) {
row = 14;
}
return `https://store.tmui.design/api_v2/public/random_picture?random=1&row=${row}&width=${width}`
}
return {
getRandomImage,
getImageList,
}
}