diff --git a/index.html b/index.html index 12591fc60f963686c74621ae2acdd74669d566f7..32f0431578971a79193e600a43df39e08b12da6e 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@ el: '#main', themeColor: '#876296', // 项目名称 - name: 'RNOH三方库使用文档', + name: 'RNOH三方库说明文档', // 项目图标 // logo: '/img/icon.svg', // 仓库地址,点击右上角的Github章鱼猫头像会跳转到此地址 diff --git a/zh-cn/react-native-slider.md b/zh-cn/react-native-slider.md index e2fed193ef2dd8c0dcd2c563e56632724b46ef5a..fd11721ff8d78ab531bd1bd1047e757d032bb9eb 100644 --- a/zh-cn/react-native-slider.md +++ b/zh-cn/react-native-slider.md @@ -161,31 +161,25 @@ import { SampleView, SAMPLE_VIEW_TYPE, PropsDisplayer } from "rnoh-sample-packag import { createRNPackages } from '../RNPackagesFactory' + import { RNCSlider, SLIDER_TYPE } from "rnoh-slider" -@Entry -@Component -struct Index { - @StorageLink('RNAbility') rnAbility: RNAbility | undefined = undefined - - @Builder - buildCustomComponent(ctx: ComponentBuilderContext) { - if (ctx.descriptor.type === SAMPLE_VIEW_TYPE) { - SampleView({ - ctx: ctx.rnohContext, - tag: ctx.descriptor.tag, - buildCustomComponent: this.buildCustomComponent.bind(this) - }) - } -+ else if (ctx.descriptor.type === SLIDER_TYPE) { -+ RNCSlider({ -+ ctx: ctx.rnohContext, -+ tag: ctx.descriptor.tag, -+ buildCustomComponent: this.buildCustomComponent.bind(this) -+ }) -+ } - ... +@Builder +function CustomComponentBuilder(ctx: ComponentBuilderContext) { + if (ctx.componentName === SAMPLE_VIEW_TYPE) { + SampleView({ + ctx: ctx.rnohContext, + tag: ctx.descriptor.tag, + buildCustomComponent: CustomComponentBuilder + }) } - ... ++ else if (ctx.componentName === SLIDER_TYPE) { ++ RNCSlider({ ++ ctx: ctx.rnohContext, ++ tag: ctx.descriptor.tag, ++ buildCustomComponent: CustomComponentBuilder ++ }) ++ } + ... } +... ``` ### 运行