在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:icons开源软件地址:https://gitee.com/uiw/icons开源软件介绍:uiw-iconsThe premium icon font for uiwjs Component Library. Designed by @liwen0526. Visit https://uiwjs.github.io/icons/ and check out the search feature, which has keywords identifying common icon names and styles. For example, if you search for "arrow" we call up every icon that could possibly be used as an arrow. We've also included each icon's class name for easy copy / pasting when you're developing! They are free to use and licensed under MIT. We intend for this icon pack to be used with uiw, but it’s by no means limited to it. Use them wherever you see fit, personal or commercial. Installation# v1.x +npm install uiw-iconfont --save# v2.x npm install @uiw/icons --save HTML ExampleYou can use https://uiwjs.github.io/icons/ to easily find the icon you want to use. Once you've copied the desired icon's CSS classname, simply add the icon and icon's classname, such as You need link CSS <link rel="stylesheet" type="text/css" href="node_modules/@uiw/icons/w-icon.css"> Used in Less: @import "~@uiw/icons/fonts/w-icon.css"; Used in JS: import '@uiw/icons/fonts/w-icon.css';// orimport '@uiw/icons/fonts/w-icon.less'; note: It has a <i class="w-icon-apple"></i> Or use the <style>.iconfont{ font-family: "w-icon" !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; -webkit-text-stroke-width: 0.2px; -moz-osx-font-smoothing: grayscale;}</style><span class="iconfont"></span> Or manually download and link <link rel="stylesheet" type="text/css" href="https://unpkg.com/@uiw/icons/fonts/w-icon.css"><span class="w-icon-adobe"></span> In Webpack { test: /w-icon\.(eot|ttf|svg)$/, use: [ { loader: require.resolve('url-loader'), options: { limit: 8192 } }, { loader: require.resolve('file-loader'), options: { name: 'static/fonts/[name].[hash:8].[ext]', } } ]}, ReactCreate an import React from 'react';import svgPaths from '@uiw/icons/fonts/w-icon.json';const renderSvgPaths = (type) => { const pathStrings = svgPaths[type]; if (pathStrings == null) { return null } return pathStrings.map((d, i) => <path key={i} d={d} fillRule="evenodd" />)}export default class Icon extends React.PureComponent { render() { const { type, color } = this.props; if (type == null || typeof type === "boolean") { return null; } return ( <svg fill={color} viewBox={`0 0 24 24`}>{this.renderSvgPaths(type)}</svg> ); }} Use the const demo = () => { return ( <Icon type="heart-on" /> )} DevelopmentRun the To build npm run font To build site and push gh-pages branch npm run start LicenseCreated By svgtofont, Licensed under the MIT License. |
请发表评论