diff --git a/zh-cn/react-native-render-html.md b/zh-cn/react-native-render-html.md index 267c81c0a7e0161aa2f7137efe772b77179e4117..8a902255a0fcf786be450903f9c532f57660e6d2 100644 --- a/zh-cn/react-native-render-html.md +++ b/zh-cn/react-native-render-html.md @@ -1,15 +1,14 @@ - -> 模板版本:v0.1.3 +> 模板版本:v0.2.2

react-native-render-html

- Supported platforms + Supported platforms - - License + https://github.com/meliorence/react-native-render-html/blob/master/LICENSE + License

@@ -63,6 +62,7 @@ export default function App() { 1. RNOH:0.72.11; SDK:OpenHarmony(api11) 4.1.0.53; IDE:DevEco Studio 4.1.3.412; ROM:2.0.0.52; 2. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.58; +3. RNOH:0.72.26; SDK:HarmonyOS NEXT Developer Beta1(api12) 5.0.0.25 ; IDE:DevEco Studio 5.0.3.300; ROM:3.0.0.25; ## 属性 @@ -74,40 +74,38 @@ export default function App() { **组件 RenderHtml** -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | -------- | -------- | ----------------------------------------------------------------- | -| allowedStyles | Whitelist specific inline CSS style properties and ignore the others. | CSSPropertyNameList | NO | All | Yes | -| baseStyle | The default style for the document (root). Inheritable styles will be transferred to children. That works also for textual styles. | MixedStyleDeclaration | NO | All | Yes | -| classesStyles | Provide mixed styles to target elements selected by CSS classes. | Readonly> | NO | All | Yes | -| computeEmbeddedMaxWidth | A function which takes contentWidth and tagName as arguments and returns a new width. Can return Infinity to denote unconstrained widths. | (contentWidth: number, tagName: string) => number | NO | All | Yes | -| contentWidth | The width of the HTML content to display. The recommended practice is to pass useWindowDimensions().width minus any padding or margins. | number | NO | All | Yes | -| customHTMLElementModels | Customize element models for target tags. | HTMLElementModelRecord | NO | All | Yes | -| defaultTextProps | Default props for Text elements in the render tree. | TextProps | NO | All | Yes | -| defaultViewProps | Default props for View elements in the render tree. | ViewProps | NO | All | Yes | -| domVisitors | An object which callbacks will be invoked when a DOM element or text node has been parsed and its children attached. This is great to tamper the dom, remove children, insert nodes, change text nodes data... etc. | DomVisitorCallbacks | NO | All | Yes | -| emSize | The default value in pixels for 1em. | number | NO | All | Yes | -| enableCSSInlineProcessing | Enable or disable inline CSS processing of inline styles. | boolean | NO | All | Yes | -| enableExperimentalMarginCollapsing | Enable or disable margin collapsing CSS behavior (experimental!). | boolean | NO | All | Yes | -| idsStyles | Enable or disable margin collapsing CSS behavior (experimental!). | boolean | NO | All | Yes | -| ignoreDomNode | Ignore specific DOM nodes. | (node: Node, parent: NodeWithChildren) => unknown | NO | All | Yes | -| ignoredDomTags | A list of lowercase tags which should not be included in the DOM. | Array | NO | All | Yes | -| ignoredStyles | Blacklist specific inline CSS style properties and allow the others. | CSSPropertyNameList | NO | All | Yes | -| onDocumentMetadataLoaded | Handler invoked when the document metadata is available. It will re-trigger on HTML content changes. | (documentMetadata: DocumentMetadata) => void | NO | All | Yes | -| onHTMLLoaded | Triggered when HTML is available to the RenderHTML component. | (html: string) => void | NO | All | Yes | -| onTTreeChange | Triggered when the transient render tree changes. Useful for debugging. | (ttree: TDocument) => void | NO | All | Yes | -| renderers | Your custom renderers. | CustomTagRendererRecor | NO | All | Yes | -| source | The object source to render (either { uri }, { html } or { dom }). | HTMLSource | Yes | All | partially(已验证 html) | -| renderersProps | Props to use in custom renderers with useRendererProps. | Partial | NO | All | partially(已验证 img 的百分比属性 enableExperimentalPercentWidth) | -| tagsStyles | Provide mixed styles to target HTML tag names. | Readonly> | NO | All | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| ---------------------------------- | ------------------------------------------------------------ | ------------------------------------------------- | -------- | -------- | ------------------------------------------------------------ | +| allowedStyles | Whitelist specific inline CSS style properties and ignore the others. | CSSPropertyNameList | NO | All | Yes | +| baseStyle | The default style for the document (root). Inheritable styles will be transferred to children. That works also for textual styles. | MixedStyleDeclaration | NO | All | Yes | +| classesStyles | Provide mixed styles to target elements selected by CSS classes. | Readonly> | NO | All | Yes | +| computeEmbeddedMaxWidth | A function which takes contentWidth and tagName as arguments and returns a new width. Can return Infinity to denote unconstrained widths. | (contentWidth: number, tagName: string) => number | NO | All | Yes | +| contentWidth | The width of the HTML content to display. The recommended practice is to pass useWindowDimensions().width minus any padding or margins. | number | NO | All | Yes | +| customHTMLElementModels | Customize element models for target tags. | HTMLElementModelRecord | NO | All | Yes | +| defaultTextProps | Default props for Text elements in the render tree. | TextProps | NO | All | Yes | +| defaultViewProps | Default props for View elements in the render tree. | ViewProps | NO | All | Yes | +| domVisitors | An object which callbacks will be invoked when a DOM element or text node has been parsed and its children attached. This is great to tamper the dom, remove children, insert nodes, change text nodes data... etc. | DomVisitorCallbacks | NO | All | Yes | +| emSize | The default value in pixels for 1em. | number | NO | All | Yes | +| enableCSSInlineProcessing | Enable or disable inline CSS processing of inline styles. | boolean | NO | All | Yes | +| enableExperimentalMarginCollapsing | Enable or disable margin collapsing CSS behavior (experimental!). | boolean | NO | All | Yes | +| idsStyles | Enable or disable margin collapsing CSS behavior (experimental!). | boolean | NO | All | Yes | +| ignoreDomNode | Ignore specific DOM nodes. | (node: Node, parent: NodeWithChildren) => unknown | NO | All | Yes | +| ignoredDomTags | A list of lowercase tags which should not be included in the DOM. | Array | NO | All | Yes | +| ignoredStyles | Blacklist specific inline CSS style properties and allow the others. | CSSPropertyNameList | NO | All | Yes | +| onDocumentMetadataLoaded | Handler invoked when the document metadata is available. It will re-trigger on HTML content changes. | (documentMetadata: DocumentMetadata) => void | NO | All | Yes | +| onHTMLLoaded | Triggered when HTML is available to the RenderHTML component. | (html: string) => void | NO | All | Yes | +| onTTreeChange | Triggered when the transient render tree changes. Useful for debugging. | (ttree: TDocument) => void | NO | All | Yes | +| renderers | Your custom renderers. | CustomTagRendererRecor | NO | All | Yes | +| source | The object source to render (either { uri }, { html } or { dom }). | HTMLSource | Yes | All | partially(已验证 html) | +| renderersProps | Props to use in custom renderers with useRendererProps. | Partial | NO | All | partially(已验证 img 的百分比属性 enableExperimentalPercentWidth) | +| tagsStyles | Provide mixed styles to target HTML tag names. | Readonly> | NO | All | Yes | ## 遗留问题 -- [ ] img 的宽度不会随着 contentWidth 的动态修改而更改(由 RN 基座引起,RNImage 组件更新状态时 this.descriptorWrapper 没有重新赋值) - ## 其他 +img 的宽度不会随着 contentWidth 的动态修改而更改(由 RN 基座引起,RNImage 组件更新状态时 this.descriptorWrapper 没有重新赋值) [issue#638](https://github.com/meliorence/react-native-render-html/issues/638) + ## 开源协议 本项目基于 [The MIT License (MIT)](https://github.com/meliorence/react-native-render-html/blob/master/LICENSE) ,请自由地享受和参与开源。 - - \ No newline at end of file