当前位置: 首页 > news >正文

网站建设的需求是什么天津网站建设制作软件

网站建设的需求是什么,天津网站建设制作软件,国家电子商务平台,网站关键词如何做https://github.com/ant-design/ant-design-web3/pull/761/files 实现了icon-preview(通过jsdoc, 鼠标放在组件上可以看到icon的样式)#xff0c;因为打包方式、产物以及命名上有一些不同#xff0c;可能需要稍加改造。 这个同步脚本应该后续也用得上#xff0c;略加改造同步… https://github.com/ant-design/ant-design-web3/pull/761/files 实现了icon-preview(通过jsdoc, 鼠标放在组件上可以看到icon的样式)因为打包方式、产物以及命名上有一些不同可能需要稍加改造。 这个同步脚本应该后续也用得上略加改造同步 svg 可以提高后续添加 svg 的效率直接拖入图片就可以转成组件代码降低cv和命名心智。 在package.json中设置命令可以直接执行ts脚本 icons:generate: NODE_OPTIONS--experimental-specifier-resolutionnode node --loader ts-node/esm ./packages/icons/scripts/generate.ts通过 mport * as allIconDefs from ant-design/web3-icons 获取所有组件使用camelToKebab函数转换需要符合自己命名需求的组件 通过 template 设置render模版 import pkg from lodash; const { template } pkg; 全部代码 import * as fs from fs; import * as path from path; import { promisify } from util; import * as allIconDefs from ant-design/web3-icons; import pkg from lodash;const __dirname new URL(import.meta.url).pathname; const { template } pkg;const writeFile promisify(fs.writeFile);interface IconDefinition {[key: string]: any; } interface IconDefinitionWithIdentifier extends IconDefinition {svgIdentifier: string;svgBase64: string | null; }function camelToKebab(camelCaseString: string) {return camelCaseString.replace(/([a-z\d])([A-Z][a-z\d])|([A-Z](?![a-z\d]))/g, $1$3-$2).toLowerCase(); }function detectRealPath(_path: string) {try {return fs.existsSync(_path) ? _path : null;} catch (e) {return null;} }function svg2base64(svgPath: string, size 50) {const svg fs.readFileSync(svgPath, utf-8);const svgWithStyle svg.replace(/svg/, svg width${size} height${size} fill#cacaca);const base64 Buffer.from(svgWithStyle).toString(base64);return data:image/svgxml;base64,${base64}; }function walkT(fn: (iconDef: IconDefinitionWithIdentifier) PromiseT) {return Promise.all(Object.keys(allIconDefs).map((svgIdentifier) {const iconDef (allIconDefs as { [id: string]: IconDefinition })[svgIdentifier];const svgPathToKebab camelToKebab(svgIdentifier);const realSvgPath detectRealPath(path.resolve(__dirname, ../../src/svgs/${svgPathToKebab}.svg),);let svgBase64: string | null null;if (realSvgPath) {try {svgBase64 svg2base64(realSvgPath);} catch (e) {}}return fn({ svgIdentifier, svgBase64, svgPathToKebab, ...iconDef });}),); }async function generateIcons() {const iconsDir path.join(__dirname, ../../src/svgs);try {await promisify(fs.access)(iconsDir);} catch (err) {await promisify(fs.mkdir)(iconsDir);}const render template( // GENERATE BY ./scripts/generate.ts // DON NOT EDIT IT MANUALLY import * as React from react; import AntdIcon from ant-design/icons; import { type IconBaseProps } from ant-design/icons/lib/components/Icon; import { ConfigProvider } from antd; import classnames from classnames;import SVGComponent from ../svgs/% svgPathToKebab %.svg;% if (svgBase64) { % /**![外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传](https://img-home.csdnimg.cn/images/20230724024159.png?origin_url%3C%25%3D%20svgBase64%20%25%3Epos_idimg-c6iaG6Dw-1712112320363) */ % } % export const % svgIdentifier % React.forwardRefHTMLSpanElement, IconBaseProps((props, ref) {const { getPrefixCls } React.useContext(ConfigProvider.ConfigContext);const prefixCls getPrefixCls(web3-icon-% svgPathToKebab %);return (AntdIcon{...props}className{classnames(prefixCls, props.className)}ref{ref}component{SVGComponent}/); });% svgIdentifier %.displayName % svgIdentifier %;.trim(),);await walk(async (item) {// generate icon fileconst svgPathToKebab camelToKebab(item.svgIdentifier);try {await writeFile(path.resolve(__dirname, ../../src/components/${svgPathToKebab}.tsx),render(item),);} catch (error) {}});// generate icon indexconst entryText Object.keys(allIconDefs).sort().map((svgIdentifier) export * from ./components/${camelToKebab(svgIdentifier)};).join(\n);await promisify(fs.appendFile)(path.resolve(__dirname, ../../src/index.ts),// GENERATE BY ./scripts/generate.ts// DON NOT EDIT IT MANUALLY${entryText}.trim(),); }generateIcons();
http://www.pierceye.com/news/527036/

相关文章:

  • 网站建设公司商务网站项目书中堂东莞网站建设
  • 欧美品牌网站设计wordpress好用的文章编辑器
  • 长春网站建设q479185700強wordpress数学公式的代码
  • 郑州软件app开发公司嘉兴优化网站排名
  • 可以建微信网站的做网站的项目开发计划书
  • 湖北网站建设模板下载太原线上教学
  • 西宁网站建设开发公司开发网站监控工具
  • 外贸网站优势杭州百度快速排名提升
  • 制作个人网站论文ipage wordpress
  • 十堰建设网站首页优化大师免安装版
  • 深圳建设企业网站公司敬请期待素材
  • 网络营销网站建设课程wordpress 文章描述
  • 网站制作有什么好的介绍北京网站建设及推广招聘
  • 殡仪馆做网站的好处制作响应式网站报价
  • 网站建设平台杭州做网站前台后台是怎么连接的
  • 太原市0元网站建设wordpress wcps
  • 怎么自己做免费网站wordpress 优酷通用代码自适应
  • 网站设置三方交易深圳品牌设计公司招聘
  • 东莞响应式网站哪家好网站开发应用到的技术名词
  • 背景做网站公司docker wordpress
  • 吉林建设监理协会网站网站 服务器 虚拟主机
  • 食品公司网站设计项目和男朋友都是第一次做网站
  • wordpress the7.6搜索引擎优化工作原理的先后顺序
  • 淘宝不允许 网站建设微网站如何做宣传
  • 海西高端网站建设价格怎样开通微信小商店
  • 学校校园网站建设方案南宁有做门户网站的公司吗
  • 一般电商都是在哪些网站上做wordpress 获取所有子页面
  • 长沙岳麓区网站开发网址大全首页
  • 学网站建设难不难专业网页美工招聘
  • 网站制作的公司有哪些四川成都有什么好玩的