Skip to content

Commit

Permalink
doc(Button): update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 3, 2021
1 parent d551c1f commit 85f0950
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
47 changes: 12 additions & 35 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,46 +109,23 @@ export default class Demo extends React.Component {

## Development

```
yarn install
```

```bash
Run instructions for iOS:
cd react-native-uiw && react-native run-ios
- or -
• Open ReactNativeUIW/ios/ReactNativeUIW.xcworkspace in Xcode or run "xed -b ios"
• Hit the Run button
Run instructions for Android:
• Have an Android emulator running (quickest way to get started), or a device connected.
cd react-native-uiw && react-native run-android
# Install current dependencies, and dependencies in sub-packages
yarn install
yarn run build # Compile package
```

⚠️ MacBook Pro with a M1

```bash
# Install ffi
sudo arch -x86_64 gem install ffi
# Re-install dependency
arch -x86_64 pod install
```
Real-time monitoring of package and document website local preview

```bash
rm -rf ios/build
# https://github.com/react-navigation/react-navigation/issues/6071
cd ios/
pod install

# Clear pods.
pod deintegrate
# pod rm Podfile.lock
pod install
# Reinstall pods
pod install --repo-update --verbose

# Run Project
yarn run ios
# Step 1
yarn run lib:watch # Compile and output JS file
# Step 2
yarn run lib:watch:type # Output type file d.ts
# Step 3
yarn run start # Run the preview document website locally
```

- [React Native upgrade helper](https://react-native-community.github.io/upgrade-helper/)
### License

Licensed under the MIT License.
45 changes: 34 additions & 11 deletions packages/core/src/Button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,37 @@ function Demo() {

组件继承 [`TouchableOpacity`](https://facebook.github.io/react-native/docs/touchableopacity#docsNav)

| 参数 | 说明 | 类型 | 默认值 |
|------|------|-----|------|
| `color` | 设置按钮颜色 | String | - |
| `textStyle` | 如果按钮内是文本,此样式可以设置文本样式 | `TextProps.Style` | - |
| `disabled` | 设置禁用 | Boolean | - |
| `loading` | 加载状态 | Boolean | - |
| `rounded` | 设置圆角 | Boolean/Number | `5` |
| `bordered` | 是否有边框 | Boolean | `true` |
| `size` | 按钮尺寸 | `small`, `default`, `large` | `default` |
| `type` | 按钮类型,可选值为 | `primary`, `success`, `warning`, `danger`, `light`, `dark` | - |

```ts
import { TextProps, TouchableOpacityProps } from 'react-native';
export interface ButtonProps extends TouchableOpacityProps {
color?: string;
/**
* 如果子节点是文本,修改文本样式
*/
textStyle?: TextProps['style'];
/**
* 设置禁用
*/
disabled?: boolean;
/**
* 加载状态
*/
loading?: boolean;
/**
* 按钮类型,可选值为
*/
type?: 'primary' | 'success' | 'warning' | 'danger' | 'light' | 'dark';
/**
* 按钮尺寸
*/
size?: 'small' | 'default' | 'large';
/**
* 设置按钮圆角
*/
rounded?: boolean | number;
/**
* 设置是否显示边框
*/
bordered?: boolean;
}
```

0 comments on commit 85f0950

Please sign in to comment.