From db30835c0e21d4d1b32633a8646ae5bcf18bb30f Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 6 Jul 2015 20:04:26 +0800 Subject: [PATCH] require antd --- components/breadcrumb/demo/basic.md | 2 +- components/datepicker/demo/basic.md | 2 +- docs/getting-started.md | 2 ++ site/templates/component.html | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/breadcrumb/demo/basic.md b/components/breadcrumb/demo/basic.md index 54a047ea4a..ab42d4cffa 100644 --- a/components/breadcrumb/demo/basic.md +++ b/components/breadcrumb/demo/basic.md @@ -7,7 +7,7 @@ --- ````jsx -var Breadcrumb = require('antd/components/breadcrumb'); +var Breadcrumb = require('antd/lib/breadcrumb'); React.render( diff --git a/components/datepicker/demo/basic.md b/components/datepicker/demo/basic.md index 2d650bf067..d1f1ba75be 100644 --- a/components/datepicker/demo/basic.md +++ b/components/datepicker/demo/basic.md @@ -7,7 +7,7 @@ --- ````jsx -// or require('antd/components/datepicker'); +// or require('antd/lib/datepicker'); var Datepicker = antd.Datepicker; React.render( diff --git a/docs/getting-started.md b/docs/getting-started.md index e28aea072e..9990d50d58 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -85,6 +85,8 @@ React.render(, document.body); > `var Datepicker = require('antd/lib/Datepicker')` 单独引入需要的组件文件可以有效减少最终构建文件的大小。 +> `lib` 即构建后的 `components` 目录。 + 然后建一个页面用于开发。 ```bash diff --git a/site/templates/component.html b/site/templates/component.html index 71e94dc1fa..28a0703be3 100644 --- a/site/templates/component.html +++ b/site/templates/component.html @@ -6,7 +6,7 @@ window.require = function(path) { var result = window; if (path.indexOf('antd') < 0 || - path.indexOf('antd/components/') < 0) { + path.indexOf('antd/lib/') < 0) { throw 'There should not have modules here 1.'; } var namespaces = path.split('/'); @@ -14,7 +14,7 @@ window.require = function(path) { if (i === namespaces.length - 1) { key = capitalizeFirstLetter(key); } - if (key !== 'components') { + if (key !== 'lib') { if (result[key]) { result = result[key]; } else {