
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Web / Weex / 阿里小程序 / 微信小程序
图标组件,实现了 W3C 标准的 IconFont 接口。
$ npm install rax-icon --save
属性 | 类型 | 默认值 | 必填 | 描述 | 支持 |
---|---|---|---|---|---|
source.uri | String | - | 否 | 图片型icon的url或iconfont的url | |
fontFamily | String | - | 否 | iconfont的字体 | |
source.codePoint | String | - | 否 | iconfont的码点 |
IconComponent createIconSet(Object map, String name, String url);
(小程序编译时模式不支持)
属性 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
map | Object | - | 是 | 描述字符集映射,eg:{ hello: '\ue60f' } |
name | String | - | 是 | 字体名称 |
url | String | - | 是 | 字体文件的 URL |
属性 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
name | String | - | 否 | 字符的名称 |
codePoint | String | - | 否 | iconfont 的码点 |
import { createElement, render, Component } from 'rax';
import DriverUniversal from 'driver-universal';
import View from 'rax-view';
import Icon, { createIconSet } from '../src/index';
const IconFont1 = createIconSet({}, 'iconfont', 'https://at.alicdn.com/t/font_pkm0oq8is8fo5hfr.ttf');
const IconFont2 = createIconSet({
hello: '\uE60f'
}, 'iconfont', 'https://at.alicdn.com/t/font_pkm0oq8is8fo5hfr.ttf');
const icon = 'https://gw.alicdn.com/tfs/TB1KRRuQXXXXXbwapXXXXXXXXXX-200-200.png';
class Demo extends Component {
render() {
return (
<View>
<Icon source={{uri: icon}}/>
<Icon fontFamily="iconfont" source={{uri: 'https://at.alicdn.com/t/font_pkm0oq8is8fo5hfr.ttf', codePoint: '\uE60f'}}/>
<IconFont1 codePoint={'\uE60f'}/>
<IconFont2 name={'hello'}/>
</View>
);
}
}
render(<Demo />, document.body, { driver: DriverUniversal });
FAQs
icon component for Rax.
We found that rax-icon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.