diff --git a/.gitignore b/.gitignore index 9b0000159..68d284393 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ node_modules .cache dist debug.tsx +debug.md assets/**/*.css build lib @@ -37,3 +38,5 @@ tsconfig.test.json .prettierignore .storybook storybook/index.js +.doc +.umi \ No newline at end of file diff --git a/.umirc.ts b/.umirc.ts new file mode 100644 index 000000000..30754d85f --- /dev/null +++ b/.umirc.ts @@ -0,0 +1,19 @@ +// more config: https://d.umijs.org/config +import { defineConfig } from 'dumi'; + +export default defineConfig({ + title: 'rc-select', + favicon: + 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', + logo: + 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', + outputPath: '.doc', + exportStatic: {}, + styles: [ + ` + .markdown table { + width: auto !important; + } + `, + ] +}); \ No newline at end of file diff --git a/README.md b/README.md index 8d99f55b5..e500f50d5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ React Select ### basic use -```js +```jsx | pure import Select, { Option } from 'rc-select'; export default () => ( @@ -102,11 +102,11 @@ export default () => ( | optionFilterProp | which prop value of option will be used for filter if filterOption is true | String | 'value' | | filterSort | Sort function for search options sorting, see [Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)'s compareFunction. | Function(optionA:Option, optionB: Option) | - | | optionLabelProp | render option value or option children as content of select | String: 'value'/'children' | 'value' | -| defaultValue | initial selected option(s) | String/Array | - | -| value | current selected option(s) | String/Array/{key:String, label:React.Node}/Array<{key, label}> | - | +| defaultValue | initial selected option(s) | String \| String[] | - | +| value | current selected option(s) | String \| String[] \| {key:String, label:React.Node} \| {key:String, label:React.Node}[] | - | | labelInValue | whether to embed label in value, see above value type. Not support `combobox` mode | Bool | false | | backfill | whether backfill select option to search input (Only works in single and combobox mode) | Bool | false | -| onChange | called when select an option or input value change(combobox) | function(value, option:Option/Array