소스 검색

blocks: change block base url

陈帅 6 년 전
부모
커밋
67b0dcd90b
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      config/config.ts
  2. 1 1
      src/components/CopyBlock/index.tsx

+ 3 - 0
config/config.ts

@@ -90,6 +90,9 @@ export default {
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION:
     ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION:
       ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
       ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION || '', // preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
   },
   },
+  block: {
+    defaultGitUrl: 'https://github.com/ant-design/pro-blocks',
+  },
   treeShaking: true,
   treeShaking: true,
   targets: {
   targets: {
     ie: 11,
     ie: 11,

+ 1 - 1
src/components/CopyBlock/index.tsx

@@ -16,7 +16,7 @@ const firstUpperCase = (pathString: string) => {
 const BlockCodeView: React.SFC<{
 const BlockCodeView: React.SFC<{
   url: string;
   url: string;
 }> = ({ url }) => {
 }> = ({ url }) => {
-  const blockUrl = `npx umi block add ant-design-pro/${firstUpperCase(url)}  --path=${url}`;
+  const blockUrl = `npx umi block add ${firstUpperCase(url)}  --path=${url}`;
   return (
   return (
     <div className={styles['copy-block-view']}>
     <div className={styles['copy-block-view']}>
       <Typography.Paragraph copyable>
       <Typography.Paragraph copyable>