ant-design / ant-design-blocks Goto Github PK
View Code? Open in Web Editor NEWumi blocks of Ant Design.
umi blocks of Ant Design.
Even when using Ant Design english, the umi-blocks.json
that is pulled in is not english:
This is because the way we generate blocks is the following (https://github.com/ant-design/ant-design-blocks/blob/master/src/index.js#L104)
...
spinner.start('generate umi-block.json');
let blockList = [];
for (let index = 0; index < demosWithText.length; index++) {
const demoWithText = demosWithText[index];
const { name, componentName, mdBaseName, text, componentType } = demoWithText;
const description = parseDesc(text);
const demoTitle = parseTitle(text);
if (fs.existsSync(path.join(__dirname, '../', name))) {
const title = `${componentName}-${demoTitle}`;
const img = `https://raw.githubusercontent.com/ant-design/ant-design-blocks/master/${name}/snapshot.png`;
const previewUrl = `https://ant.design/components/${componentName}-cn/#components-${componentName}-demo-${mdBaseName}`;
const url = `https://github.com/ant-design/ant-design-blocks/tree/master/${name}`;
const tags = [componentType];
blockList.push({
title,
value: name,
key: name,
description,
url,
type: 'block',
path: name,
isPage: false,
defaultPath: `/${name}`,
img,
tags,
name: title,
previewUrl,
features: ['antd'],
});
}
}
...
There's a few things we could do (this is all very much pseudocode):
let basePreviewUrl = `https://ant.design/components/${componentName}`
if (locale !== 'en-US') {
basePreviewUrl = `${basePreviewUrl}-${locale}
}
const previewUrl = `${basePreviewUrl}/#components-${componentName}-demo-${mdBaseName}`
For the title
, tags
, and description
, maybe we can also not just pull from package.json
for the component, but instead have some alternative versions of these based on the locale?
Similarly, in FetchAntdDemos
(https://github.com/ant-design/ant-design-blocks/blob/master/src/fetchAntDDemos.js#L18), we parse out the index.zh-CN.md
, but maybe we could do something like index.${locale}.md
or something along those lines.
https://preview.pro.ant.design/list/basic-list
https://preview.pro.ant.design/list/basic-list
pageSize 切换器无效
切换分页大小
无效
Environment | Info |
---|---|
antd | 4.6.4 |
React | unknown |
System | Catalina 10.15.6 |
Browser | Chrome Version 85.0.4183.102 |
是否可以把ant-design-blocks升级到antd4.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.