Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

astros-2ximg

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astros-2ximg

会根据二倍图生成一倍图。

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

astros-2ximg

Astros插件

项目中如果需要针对高清屏设置二倍图时,通常的做法是切两个尺寸的图片。

现在,你只需要准备好一张二倍图。存储图片时,文件名以2x结尾。正常引用1倍图和2倍图即可,例:

图片位置:

root/img/logo2x.png

如何引用:

root/pages/user/login/login.html:

<img src="$res(~/img/logo.png)" srcset="$res(~/img/logo2x.png) 2x" />

root/components/header/header-menu.html:

<img src="$res(~/img/logo.png") srcset="$res(~/img/logo2x.png) 2x" />

root/components/header/header-menu.less:

background:url(~/img/logo.png);
background:url(~/img/logo2x.png);

你没有看错,除了文件名末尾加2x,不需要其他额外的操作。

FAQs

Package last updated on 17 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts