Skip to content

Commit 9d0937e

Browse files
authored
docs: update readme (#2)
1 parent c8be6d5 commit 9d0937e

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.umirc.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
// more config: https://d.umijs.org/config
22
import { defineConfig } from 'dumi';
33

4+
const basePath = process.env.GH_PAGES ? '/segmented/' : '/';
5+
const publicPath = process.env.GH_PAGES ? '/segmented/' : '/';
6+
47
export default defineConfig({
58
title: 'rc-segmented',
69
favicon: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
710
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
811
outputPath: '.doc',
912
exportStatic: {},
10-
base: '/',
11-
publicPath: '/',
13+
base: basePath,
14+
publicPath,
1215
hash: true,
1316
styles: [
1417
`

docs/examples/basic.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ export default function App() {
1111
onChange={(e) => console.log(e.target.value, typeof e.target.value)}
1212
/>
1313
</div>
14-
<div className="wrapper">
15-
<Segmented
16-
options={['iOS', 'Android', null, undefined, '', 'Web']}
17-
onChange={(e) => console.log(e.target.value, typeof e.target.value)}
18-
/>
19-
</div>
2014
<div className="wrapper">
2115
<Segmented
2216
options={[13333333333, 157110000, 12110086]}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"docs:build": "dumi build",
3535
"docs:deploy": "gh-pages -d .doc",
3636
"compile": "father build && lessc assets/index.less assets/index.css",
37-
"gh-pages": "npm run docs:build && father doc deploy",
37+
"gh-pages": "GH_PAGES=1 npm run docs:build && father doc deploy",
3838
"prepublishOnly": "npm run compile && np --yolo --no-publish && npm run gh-pages",
3939
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
4040
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",

src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,14 @@ const Segmented = React.forwardRef<HTMLDivElement, SegmentedProps>(
156156
setSelected(value);
157157

158158
if (onChange) {
159-
const mutationTarget = Object.create(event.target, {
159+
const mutatedTarget = Object.create(event.target, {
160160
value: {
161161
value,
162162
},
163163
});
164164
const mutatedEvent = Object.create(event, {
165165
target: {
166-
value: mutationTarget,
166+
value: mutatedTarget,
167167
},
168168
});
169169
onChange(mutatedEvent);

0 commit comments

Comments
 (0)