From 0d669b0e9c2ee103538639c63f1c77638b764958 Mon Sep 17 00:00:00 2001 From: lightShowers <46345829+lightShowers@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:05:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?taro=203.0=20=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit taro 3.0 使用 --- ParserRichText/parserRichText.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ParserRichText/parserRichText.tsx b/ParserRichText/parserRichText.tsx index 240ed2f..e17dd8c 100644 --- a/ParserRichText/parserRichText.tsx +++ b/ParserRichText/parserRichText.tsx @@ -97,11 +97,11 @@ class ParserRichText extends Taro.Component { imgMode: 'default' }; - public config: Taro.Config = { - usingComponents: { - parser: './Parser/index' - } - }; +// public config: Taro.Config = { +// usingComponents: { +// parser: './Parser/index' +// } +// }; public render(): JSX.Element { const { From 6dbdefaf04d607069f60f749082b2f4059eb0f6a Mon Sep 17 00:00:00 2001 From: lightShowers <46345829+lightShowers@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:08:32 +0800 Subject: [PATCH 2/3] taro 3.0 taro 3.0 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f5cfe4..a7917bb 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,12 @@ 2. 在需要富文本渲染的页面/组件中导入组件 `import ParserRichText from '组件路径';` 3. 需要使用的地方使用 `ParserRichText` 组件即可,访问 [Parser](https://github.com/jin-yufeng/Parser) 了解参数详情及注意事项 4. 在 [NervJS/taro#3885](https://github.com/NervJS/taro/issues/3885) 未解决之前,需要在 config/index.js 文件中添加 config.copy.patterns 复制组件到目标文件夹。参考:[config/index.js#L32](https://github.com/xPixv/SteamCN-Mini-Program/blob/f6ca35869f434127f9d88eb7db3977adb7fd1eb0/config/index.js#L32) - +5. Taro3 的组件是没有配置文件的,因此 usingComponents 必须配置在“页面”的配置文件中。 + export default { + usingComponents: { + parser: 'components/common/ParserRichText/Parser/index' + } + } **请访问 [Parser](https://github.com/jin-yufeng/Parser) 原仓库了解更多参数详解及注意事项** ## Demo 示例 From 6f0df15b1e839fbbdac3eec1a0d207d7756748f1 Mon Sep 17 00:00:00 2001 From: lightShowers <46345829+lightShowers@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:21:09 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7917bb..1b0b287 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,14 @@ 3. 需要使用的地方使用 `ParserRichText` 组件即可,访问 [Parser](https://github.com/jin-yufeng/Parser) 了解参数详情及注意事项 4. 在 [NervJS/taro#3885](https://github.com/NervJS/taro/issues/3885) 未解决之前,需要在 config/index.js 文件中添加 config.copy.patterns 复制组件到目标文件夹。参考:[config/index.js#L32](https://github.com/xPixv/SteamCN-Mini-Program/blob/f6ca35869f434127f9d88eb7db3977adb7fd1eb0/config/index.js#L32) 5. Taro3 的组件是没有配置文件的,因此 usingComponents 必须配置在“页面”的配置文件中。 - export default { +~~~ +export default { usingComponents: { - parser: 'components/common/ParserRichText/Parser/index' + parser: 'components/common/ParserRichText/Parser/index' } - } +} +~~~ + **请访问 [Parser](https://github.com/jin-yufeng/Parser) 原仓库了解更多参数详解及注意事项** ## Demo 示例