Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.