diff --git a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-richeditor.md b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-richeditor.md index 30734582fa0e27263cc5ef1430f2f8d8ac61dea3..038601d62758ae0a74e847365f1752f0be11ab44 100644 --- a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-richeditor.md +++ b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-richeditor.md @@ -5232,4 +5232,38 @@ struct StyledUndo { } } ``` -![UndoStyle](figures/richEditorStyledUndo.gif) \ No newline at end of file +![UndoStyle](figures/richEditorStyledUndo.gif) + +### 示例29(设置资源类型作为参数) + +addTextSpan支持入参为Resource类型。 + +```ts +// xxx.ets +@Entry +@Component +struct RichEditorExample { + + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller } + + build() { + Column() { + Column() { + RichEditor(this.options) + .onReady(() => { + this.controller.addTextSpan($r("app.string.xxx"), { + style: { + fontColor: Color.Black, + fontSize: 15, + fontWeight: 400 + } + }) + }) + }.width('100%') + }.height('100%') + } +} + +``` + diff --git a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-search.md b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-search.md index 2a3c4d333de0d2c0712616eaeb9adc0b605e1fa7..48571edfe952e876ec9d2277aa3ba6c170e19604 100644 --- a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-search.md +++ b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-search.md @@ -1888,4 +1888,40 @@ struct SearchExample { } } } -``` \ No newline at end of file +``` + +### 示例20(设置资源类型作为参数) + +SearchButton和构造函数支持入参为Resource类型。 + +```ts +// xxx.ets +@Entry +@Component +struct SearchExample { + + @State changeValue: string = ''; + @State submitValue: string = ''; + + build() { + Column() { + Search({ value: $r("app.string.xxx")}) + .searchButton($r("app.string.yyy")) + .width('95%') + .height(40) + .backgroundColor('#F5F5F5') + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .textFont({ size: 14, weight: 400 }) + .onSubmit((value: string) => { + this.submitValue = value + }) + .onChange((value: string) => { + this.changeValue = value + }) + .margin(20) + }.height('100%') + } +} +``` + diff --git a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-span.md b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-span.md index 8cb92fdaec150ba5a598281b68493934522a314d..0cf940f8792e30c1e5e9285e11b77bf7ecc842fa 100644 --- a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-span.md +++ b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-span.md @@ -551,3 +551,28 @@ struct SpanExample { ![SpanBaselineOffset](figures/SpanBaselineOffset.png) +### 示例5(设置资源类型作为参数) + +letterSpacing、fontWeight支持入参为Resource类型。 + +```ts +// xxx.ets +@Entry +@Component +struct SpanExample { + build() { + Column() { + Text(){ + Span("Span_fontWeight_letterSpacing") + .fontWeight($r("app.string.xxxx")) + .letterSpacing($r("app.float.yyyy")) + } + .height(200) + .width("100%") + .backgroundColor(Color.Blue) + }.height('100%') + } +} + +``` + diff --git a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-text.md b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-text.md index 209b88d3368e3ff387ca714c08ae574205912afd..0b9a42a6346c56c8c78684e991902b577b785554 100644 --- a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-text.md +++ b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-text.md @@ -2094,4 +2094,27 @@ struct TextExample13 { } ``` -![textPrivacySensitive](figures/textPrivacySensitive.gif) \ No newline at end of file +![textPrivacySensitive](figures/textPrivacySensitive.gif) + +### 示例14(设置资源类型作为参数) + +Text:baselineOffset、letterSpacing、fontWeight支持入参为Resource。 + +```ts +@Entry +@Component +struct TextExample14 { + build() { + Column() { + Text("Text_baselineOffset_letterSpacing_fontWeight") + .height(200) + .width("100%") + .backgroundColor(Color.Red) + .fontWeight($r("app.string.xxx"), { enableVariableFontWeight:true }) + .baselineOffset($r("app.float.yyy")) + .letterSpacing($r("app.float.zzz")) + }.height('100%') + } +} +``` + diff --git a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textarea.md b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textarea.md index 1893790af5428a990577482c270067a54b1c4223..886adaebe9e1183aed3943f99876f7674ea4fc70 100644 --- a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textarea.md +++ b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textarea.md @@ -2190,4 +2190,25 @@ struct TextAreaExample { } ``` -![textAreaSetTextSelection](figures/textAreaSetTextSelection.gif) \ No newline at end of file +![textAreaSetTextSelection](figures/textAreaSetTextSelection.gif) + +### 示例19(设置资源类型作为参数) + +fontWeight支持入参为Resource类型 + +```ts +// xxx.ets +@Entry +@Component +struct TextAreaExample { + build() { + Column() { + TextArea({text:"TextArea_fontWeight"}) + .width(300) + .backgroundColor(Color.Red) + .fontWeight($r("app.string.xxx")) + }.height('100%') + } +} +``` + diff --git a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textinput.md b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textinput.md index dbb8e30626f73f75b7508449284541d0944477a2..7a00cc8e0cc3ad554edabc23c99103525ae833c9 100644 --- a/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textinput.md +++ b/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-basic-components-textinput.md @@ -2774,4 +2774,28 @@ struct TextInputExample { } ``` -![textInputSetTextSelection](figures/textInputSetTextSelection.gif) \ No newline at end of file +![textInputSetTextSelection](figures/textInputSetTextSelection.gif) + +### 示例20(设置资源类型作为参数) + +fontWeight支持入参为Resource类型 + +```ts +// xxx.ets +@Entry +@Component +struct TextInputExample { + build() { + Column() { + TextInput({ placeholder: 'TextInput_fontWeight' }) + .width('95%') + .height(40) + .margin(20) + .maxLength(9) + .fontWeight($r("app.string.xxx")) + }.height('100%') + } +} + +``` +