Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
版本1.1.5,添加onLoaded回调,用于解析完成通知
Browse files Browse the repository at this point in the history
  • Loading branch information
werfei committed May 30, 2020
1 parent 0203fd1 commit c6b24ab
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <p align="center">TaroParse taro版本富文本解析组件</p>
## <p align="center">支持Html及markdown可视化</p>
##### <p align="center"><code>版本号:1.1.4</code></p>
##### <p align="center"><code>版本号:1.1.5</code></p>
## 特色
- 支持LaTex数学公式
- 支持yuml流程图
Expand All @@ -10,6 +10,7 @@
- 支持typographer字符替换
- 支持多主题切换
- 支持Markdown TodoList
- 支持解析完成回调
- 目前只支持h5和微信小程序,别的小程序平台现在样式问题暂未解决(<b>小程序没太深入研究过,各位大佬如果有方案,欢迎指导</b>)
## 使用方式
#### 1、安装 ` taro-parse `
Expand All @@ -30,6 +31,7 @@ import TaroParser from 'taro-parse'
| theme| String | 主题 'light' \| 'dark'|
| content| String | 要解析的内容 |
| onImgClick| Function| 图片点击回调|
| onLoaded| Function| 文档解析完成回调(在渲染前)|
| onLinkClick| Function| 链接点击回调 |
| yumlApi| String|| yuml流程图云解析地址 |
| latexApi| String|| latex数学公式云解析地址 |
Expand Down Expand Up @@ -67,14 +69,19 @@ export default class Index extends Component {
}
render() {
const content = '### HelloWorld'
Taro.showLoading({title: '加载中...'}).then(() => {
})
const content = markdown
return (
<View className='index'>
<TaroParser
type='markdown'
theme='light'
onImgClick={this.imgClick}
onLinkClick={this.linkClick}
onLoaded={() => {
Taro.hideLoading()
}}
yumlApi='https://md.werfei.com/?yuml'
latexApi='https://md.werfei.com/?tex'
content={content}
Expand Down

0 comments on commit c6b24ab

Please sign in to comment.