diff --git a/zh-cn/application-dev/reference/apis/js-apis-router.md b/zh-cn/application-dev/reference/apis/js-apis-router.md index 501884d2dc3a30ef1454a4dcfe9104275fd0997c..cdc0b2fe6035575533425fdd12cb654b15e384e3 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-router.md +++ b/zh-cn/application-dev/reference/apis/js-apis-router.md @@ -596,7 +596,7 @@ export default { // 在detail页面中 export default { onInit() { - console.info('showData1:' + router.getParams()[data1]); + console.info('showData1:' + router.getParams()['data1']); } } ``` diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-custom-basic-usage.md b/zh-cn/application-dev/reference/arkui-js/js-components-custom-basic-usage.md index bbd00b8c1bf389bc026f2f3617fc3cc70e93cdd4..18cf415472a1b896c485b35bea6dfe5fe0583695 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-custom-basic-usage.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-custom-basic-usage.md @@ -3,7 +3,7 @@ 自定义组件是用户根据业务需求,将已有的组件组合,封装成的新组件,可以在工程中多次调用,从而提高代码的可读性。自定义组件通过element引入到宿主页面,使用方法如下: ```html - +
@@ -12,8 +12,8 @@ 结合if-else使用自定义组件的示例,showComp1为true时显示自定义组件comp1,否则显示comp2: ```html - - + +
@@ -76,7 +76,7 @@ export default { ```html - +
@@ -125,7 +125,7 @@ export default { ```html - +
父组件:{{text}} diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-custom-props.md b/zh-cn/application-dev/reference/arkui-js/js-components-custom-props.md index a384d0cce0f98cbb715089815d29acc5285db440..882d732f5a7e097dcfb573c49b67101a85f2dfcd 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-custom-props.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-custom-props.md @@ -21,7 +21,7 @@ export default { ```html - +
@@ -57,7 +57,7 @@ export default { ```html - +
diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-custom-slot.md b/zh-cn/application-dev/reference/arkui-js/js-components-custom-slot.md index f5bceca1a24068409268c4e600872f24afafcba3..b3d541c6c8473b6a6da0d74348f0f98d97ef39cc 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-custom-slot.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-custom-slot.md @@ -20,7 +20,7 @@ 引用该自定义组件方式如下: ```html - +
父组件中定义的内容 @@ -45,7 +45,7 @@ 引用该自定义组件方式如下: ```html - +
插入第二个插槽中 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-formcomponent.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-formcomponent.md index d451d3fd941f47c54577fc54125255a713e35ea7..c8737ca8a0712ae7f8025b17fa46c1f4762c38f4 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-formcomponent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-formcomponent.md @@ -108,7 +108,7 @@ struct CardExample { .visibility(Visibility.Visible) .onAcquired((form)=>{ console.log(`form info : ${JSON.stringify(form)}`); - this.fomId = form.id; + this.formId = form.id; }) .onError((err)=>{ console.log(`fail to add form, err: ${JSON.stringify(err)}`); diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md index 36dbeca9f84b24ff8c1c7d456ff604c092833c9f..961a6a9d00237abcb571fc228c5431f4dc63593d 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md @@ -353,20 +353,16 @@ struct ImageExample3 { ### 渲染沙箱路径图片 ```ts -import fileio from '@ohos.fileio' -import fs from '@ohos.file.fs' -import context from '@ohos.application.context' +import fileio from '@ohos.fileio'; +import fs from '@ohos.file.fs'; +import context from '@ohos.app.ability.common'; @Entry @Component struct LoadImageExample { @State resourcesPath: string = '' @State sandboxPath: string = '' - context: context.AbilityContext - - aboutToAppear() { - this.context = getContext(this) as context.AbilityContext - } + context: context.UIAbility = getContext(this) as context.UIAbilityContext build() { Column() { diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-plugincomponent.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-plugincomponent.md index 6e28c15b09dd53348449554f9ed8352621b1ea1d..20a323d8d90e0fbb405a48bf24127dd09db5f8c9 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-plugincomponent.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-plugincomponent.md @@ -174,7 +174,7 @@ external.json文件由开发者创建。external.json中以键值对形式存放 ```ts //PluginUserExample.ets -import plugin from "plugin_component.js" +import plugin from "./plugin_component.js" @Entry @Component @@ -230,7 +230,7 @@ struct PluginUserExample { ```ts //PluginProviderExample.ets -import plugin from "plugin_component.js" +import plugin from "./plugin_component.js" @Entry @Component