rax-icon
icon component for Rax.
Last updated 5 years ago by recover758126 .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ npm install rax-icon 
SYNC missed versions from official npm registry.

npm

支持

Web / Weex

描述

图标组件,实现了 W3C 标准的 IconFont 接口。

安装

$ npm install rax-icon --save

属性

1、支持列表中的 browser代表h5 weex代表weex miniApp代表小程序

属性 类型 默认值 必填 描述 支持
source.uri String - 图片型icon的url,如果出现,则font和codePoint两个属性失效 browserweex
fontFamily String - iconfont的字体 browserweex
source.codePoint String - iconfont的码点 browserweex

方法

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 DU 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: DU });

Current Tags

  • 1.4.5-beta.2                                ...           beta (3 years ago)
  • 1.4.5                                ...           latest (3 years ago)

90 Versions

  • 1.4.5                                ...           3 years ago
  • 1.4.5-beta.2                                ...           3 years ago
  • 1.4.5-beta.1                                ...           3 years ago
  • 1.4.4                                ...           3 years ago
  • 1.4.4-beta.1                                ...           3 years ago
  • 1.4.3                                ...           3 years ago
  • 1.4.3-0                                ...           3 years ago
  • 1.4.2                                ...           3 years ago
  • 1.4.1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.8                                ...           4 years ago
  • 1.3.8-0                                ...           4 years ago
  • 1.3.7                                ...           4 years ago
  • 1.3.6                                ...           4 years ago
  • 1.3.5                                ...           4 years ago
  • 1.3.4                                ...           4 years ago
  • 1.3.4-beta.0                                ...           4 years ago
  • 1.3.3                                ...           4 years ago
  • 1.3.3-0                                ...           4 years ago
  • 1.3.2                                ...           4 years ago
  • 1.3.2-2                                ...           5 years ago
  • 1.3.1                                ...           5 years ago
  • 1.3.1-beta.2                                ...           5 years ago
  • 1.3.1-beta.1                                ...           5 years ago
  • 1.3.0                                ...           5 years ago
  • 1.2.1                                ...           5 years ago
  • 1.2.1-0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.1.0-6                                ...           5 years ago
  • 1.1.0-5                                ...           5 years ago
  • 1.1.0-4                                ...           5 years ago
  • 1.1.0-3                                ...           5 years ago
  • 1.1.0-2                                ...           5 years ago
  • 1.1.0-1                                ...           5 years ago
  • 1.1.0-0                                ...           5 years ago
  • 1.0.1-beta.2                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.0-beta.0                                ...           5 years ago
  • 0.6.5                                ...           6 years ago
  • 0.6.4                                ...           6 years ago
  • 0.6.3                                ...           7 years ago
  • 0.6.2                                ...           7 years ago
  • 0.6.0                                ...           7 years ago
  • 0.5.4                                ...           7 years ago
  • 0.5.2                                ...           7 years ago
  • 0.5.1                                ...           7 years ago
  • 0.5.0                                ...           7 years ago
  • 0.4.20                                ...           7 years ago
  • 0.4.19                                ...           7 years ago
  • 0.4.18                                ...           7 years ago
  • 0.4.17                                ...           7 years ago
  • 0.4.16                                ...           7 years ago
  • 0.4.15                                ...           7 years ago
  • 0.5.0-beta                                ...           7 years ago
  • 0.4.14                                ...           7 years ago
  • 0.4.13                                ...           7 years ago
  • 0.4.12                                ...           7 years ago
  • 0.4.11                                ...           7 years ago
  • 0.4.10                                ...           7 years ago
  • 0.4.9                                ...           7 years ago
  • 0.4.8                                ...           7 years ago
  • 0.4.7                                ...           7 years ago
  • 0.4.6                                ...           7 years ago
  • 0.4.5                                ...           7 years ago
  • 0.4.4                                ...           7 years ago
  • 0.4.3                                ...           7 years ago
  • 0.4.2                                ...           7 years ago
  • 0.4.1                                ...           7 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.8                                ...           7 years ago
  • 0.3.7                                ...           7 years ago
  • 0.3.6                                ...           7 years ago
  • 0.3.5                                ...           7 years ago
  • 0.3.4                                ...           7 years ago
  • 0.3.3                                ...           8 years ago
  • 0.3.2                                ...           8 years ago
  • 0.3.1                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.11                                ...           8 years ago
  • 0.2.10                                ...           8 years ago
  • 0.2.9                                ...           8 years ago
  • 0.2.8                                ...           8 years ago
  • 0.2.7                                ...           8 years ago
  • 0.2.6                                ...           8 years ago
  • 0.2.5                                ...           8 years ago
  • 0.2.4                                ...           8 years ago
  • 0.2.3                                ...           8 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (15)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE