',onCopy:i},React.createElement("li",null,React.createElement(l.default,{type:e,size:"xl"}),React.createElement("span",null,e)))}))),mountNode)}()
import 'blue/lib/icon/index.scss';
import Icon from 'blue/lib/icon';
import 'blue/lib/feedback/index.scss';
import Feedback from 'blue/lib/feedback';
import CopyToClipboard from 'react-copy-to-clipboard';
const types = [
'all', 'cart', 'comments', 'cry', 'email',
'favorite', 'folder', 'form', 'help', 'refresh',
'set', 'training', 'account', 'atm', 'clock',
'attachment', '3column', '4column', 'discount', 'service',
'print', 'box', 'process', 'bags', 'electronics',
'gifts', 'lights', 'auto', 'browse', 'atm-away',
'scanning', 'compare', 'filter', 'pin', 'history',
'similar-product', 'link', 'cut', 'table', 'nav-list',
'image-text', 'text', 'move', 'subtract', 'dollar',
'office', 'operation', 'download', 'map', 'bad',
'good', 'skip', 'play', 'stop', 'compass',
'security', 'share', 'store', 'phone', 'ellipsis',
'email-filling', 'favorites-filling', 'account-filling', 'credit-level', 'credit-level-filling',
'mobile-phone', 'smile', 'personal-center', 'arrow-up-filling', 'arrow-right',
'arrow-left', 'arrow-down', 'arrow-up', 'add', 'minus',
'delete-filling', 'edit', 'error', 'select', 'ashbin',
'calendar', 'time', 'success', 'warning', 'search',
'display', 'category', 'prompt', 'arrow-down-filling', 'sorting',
'ascending', 'descending', 'success-filling', 'picture', 'close', 'semi-select',
'tag-subscript', 'survey', 'loading', 'arrow-double-left', 'arrow-double-right'
];
const handleCopy = () => Feedback.toast.success('Copied!');
ReactDOM.render(
<div>
<h2>点击复制剪贴板</h2>
<ul className="icon-list">
{types.map((type, index) => (
<CopyToClipboard key={index} text={`<Icon type="${type}" />`} onCopy={handleCopy}>
<li>
<Icon type={type} size="xl" />
<span>{type}</span>
</li>
</CopyToClipboard>))}
</ul>
</div>
, mountNode);
.icon-list {
margin: 0;
padding: 0;
list-style: none;
}
.icon-list li {
display: inline-block;
width: 160px;
height: 80px;
cursor: pointer;
}
.icon-list li:hover {
background-color: #f7f7f7;
}
.icon-list i {
display: block;
margin: 12px auto 0 auto;
text-align: center;
}
.icon-list span {
display: block;
margin-top: 10px;
text-align: center;
}
import 'blue/lib/icon/index.scss';
import Icon from 'blue/lib/icon';
const moreHeightStyle = {
height: '40px',
padding: '0 10px',
marginBottom: '5px',
lineHeight: '40px',
background: '#ccc'
};
const absWrapperStyle = {
position: 'relative',
width: '220px',
height: '40px',
lineHeight: '40px',
background: '#ccc'
};
const absStyle = {
position: 'absolute',
right: '10px'
};
ReactDOM.render((
<div className="icon-list-style">
<h3>高度40, 行高40</h3>
<div style={moreHeightStyle}><Icon type="phone" size="xxs"/> 电话 <Icon type="phone" size="xxs"/> phone</div>
<div style={moreHeightStyle}><Icon type="phone" size="xs"/> 电话 <Icon type="phone" size="xs"/> phone</div>
<div style={moreHeightStyle}><Icon type="phone" size="small"/> 电话 <Icon type="phone" size="small"/> phone</div>
<div style={moreHeightStyle}><Icon type="phone" size="medium"/> 电话 <Icon type="phone" size="medium"/> phone
</div>
<div style={moreHeightStyle}><Icon type="phone" size="large"/> 电话 <Icon type="phone" size="large"/> phone</div>
<div style={moreHeightStyle}><Icon type="phone" size="xl"/> 电话 <Icon type="phone" size="xl"/> phone</div>
<div style={moreHeightStyle}><Icon type="phone" size="xxl"/> 电话 <Icon type="phone" size="xxl"/> phone</div>
<h3>ICON 绝对定位时的对齐</h3>
<div style={absWrapperStyle}><Icon style={absStyle} type="phone"/> 电话</div>
</div>
), mountNode);
import 'blue/lib/icon/index.scss';
import Icon from 'blue/lib/icon';
const sizes = ['xxs', 'xs', 'small', 'medium', 'large', 'xl', 'xxl', 'xxxl'];
ReactDOM.render((
<ul className="icon-sizes">
{sizes.map((size, index) => (
<li key={index}>
<Icon type="smile" size={size} />
<span>{size}</span>
</li>))}
</ul>
), mountNode);
.icon-sizes {
margin: 0;
padding: 0;
list-style: none;
}
.icon-sizes li {
display: inline-block;
width: 80px;
height: 80px;
}
.icon-sizes i {
display: block;
margin: 12px auto 0 auto;
text-align: center;
}
.icon-sizes span {
display: block;
margin-top: 10px;
text-align: center;
}