Skip to content

Commit f6edfda

Browse files
ChenlingasMxxingyuefeng
authored andcommitted
doc: NoticeBar文档修改
1 parent 5466d16 commit f6edfda

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

packages/core/src/NoticeBar/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@ NoticeBar 通告栏
33

44
在导航栏下方,一般用作系统提醒、活动提醒等通知。
55

6-
![](https://user-images.githubusercontent.com/66067296/139399394-1eb887bc-6726-43a0-a158-22a25ebf9350.gif)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
7-
86
### 基础示例
97

10-
<!--DemoStart-->
11-
```jsx
8+
```jsx mdx:preview
129
import React from 'react';
13-
import { NoticeBar, Spacing } from '@uiw/react-native';
10+
import { Image,View,Text } from 'react-native'
11+
import NoticeBar from '@uiw/react-native/lib/NoticeBar';
12+
import Spacing from '@uiw/react-native/lib/Spacing';
1413

1514
const NoticeBarExample = () => {
1615
const customIcon = (
1716
<Image
18-
// tslint:disable-next-line:jsx-no-multiline-js
1917
source={{
2018
uri: 'https://zos.alipayobjects.com/rmsportal/bRnouywfdRsCcLU.png',
2119
}}
@@ -69,15 +67,14 @@ const NoticeBarExample = () => {
6967
}
7068
export default NoticeBarExample;
7169
```
72-
<!--End-->
7370
7471
### Props
7572
7673
属性 | 说明 | 类型 | 默认值
7774
----|-----|------|------
7875
| mode | 提示类型,可选 `closable`,`link` | String | '' |
7976
| icon | 在开始位置设置图标 | ReactNode | `<Icon type={require('./trips.svg')} size="xxs" />`|
80-
| onPress | 点击关闭或者操作区域的回调函数 | (): void | |
77+
| onPress | 点击关闭或者操作区域的回调函数 | () => void | |
8178
| marqueeProps | marquee 参数 | Object | `{loop: false, leading: 500, trailing: 800, fps: 40, style: {}}` |
8279
| action | 用于替换操作 icon 的文案 | ReactElement | |
8380
| style | 用于设置通告栏样式 | ViewStyle | |
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import Markdown, { importAll } from '../../../component/Markdown';
1+
import Preview from 'src/component/Preview';
2+
import md from '@uiw/react-native/lib/NoticeBar/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/NoticeBar/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/NoticeBar/README.md');
7-
// 支持 markdown 中,相对于当前 index.tsx 相对路径引入图片资源
8-
importAll((require as any).context('./', true, /\.(png|gif|jpg|svg)$/), this.imageFiles);
9-
return md.default || md;
10-
};
11-
}
4+
const DEMO = () => <Preview {...md} />;
5+
export default DEMO;

0 commit comments

Comments
 (0)