Bilibili-Evolved/registry/lib/components/utils/image-resolution/index.ts
2021-12-05 20:52:01 +08:00

23 lines
718 B
TypeScript

import { ComponentMetadata } from '@/components/types'
import { startResolution } from './resolution'
export const component: ComponentMetadata = {
name: 'imageResolution',
displayName: '高分辨率图片',
tags: [
componentsTags.utils,
],
enabledByDefault: window.devicePixelRatio > 1,
entry: startResolution,
description: {
'zh-CN': '根据屏幕 DPI 请求更高分辨率的图片, 例如 DPI 缩放 200% 则请求 2 倍的分辨率, 加载时间也会相应变长一些. (也会导致某些浏览器里出现图片闪动, 因为本质上是更换了图片源)',
},
options: {
scale: {
displayName: '缩放级别',
defaultValue: 'auto',
hidden: true,
},
},
}