sublime查找替换
查找:
[\s\S]*?"font_class": "(.+)",[\s\S]*?"unicode_decimal": (.+)[\s\S]*?}
替换
"$1": $2,\n
index.js
import createIconSet from 'react-native-vector-icons/lib/create-icon-set';
import glyphMap from './iconfont.json';
const iconSet = createIconSet(glyphMap, 'iconfont', 'iconfont.ttf');
export default iconSet;
export const {Button, getImageSource, getImageSourceSync} = iconSet;
使用
import {registerCustomIconType} from '@rneui/themed';
const iconSet = require('./iconfont/index.js').default;
registerCustomIconType('iconfont', iconSet);
<Icon name="wode" type="iconfont" />