diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md b/zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md index 3e832dee2c127cdec7d5160e4cc9737a5aec885d..79531299e950767008dc4c755ef60140c816dfa5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md @@ -10,9 +10,10 @@ close(): void 可以通过该方法在页面范围内关闭通过[bindContextMenu](./ts-universal-attributes-menu.md#属性)给组件绑定的菜单。 -**示例:** +## 示例 -``` +```ts +// xxx.ets @Entry @Component struct Index { @@ -26,8 +27,8 @@ struct Index { }) }.height(400) .backgroundColor(Color.Pink) - } + build() { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) { Column(){ @@ -38,4 +39,4 @@ struct Index { .height('100%') } } -``` \ No newline at end of file +``` diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md index 3c15bdf0786afe6f1bede9a05f815c726e8272b5..18e7c2a42ef66d822cca4621978fb592d29c2dea 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md @@ -41,6 +41,7 @@ @Entry @Component struct MenuExample { + build() { Column() { Text('click for Menu') @@ -69,8 +70,9 @@ struct MenuExample { #### 自定义内容菜单 -``` -import router from '@system.router'; +```ts +// xxx.ets +import router from '@system.router' @Entry @Component diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md index eae7d97a240058a8d676acd8bdb283bca0266a4b..3ce01a90b6f5eab41c091d07bbf6134a967db6f0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md @@ -21,11 +21,12 @@ ## 示例 -``` +```ts // xxx.ets @Entry @Component struct ClipAndMaskExample { + build() { Column({ space: 5 }) { Text('clip').fontSize(9).width('90%').fontColor(0xCCCCCC) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-transformation.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-transformation.md index a2ec21c5dee915412b71613772d90ee9bce6fb83..e0842b4ee862730faf66ccd8a4788708be2ee09f 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-transformation.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-transformation.md @@ -23,12 +23,14 @@ ## 示例 -``` +```ts +// xxx.ets import Matrix4 from '@ohos.matrix4' @Entry @Component struct TransformExample { + build() { Column() { Text('rotate').width('90%').fontColor(0xCCCCCC).padding(15).fontSize(30) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md index 41f987afdd5e8030d1d720081ef6e3d6491c91d3..18b4258e5bddea469a77c278d41cfe8087bb34ff 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md @@ -20,7 +20,8 @@ ## 示例 -``` +```ts +// xxx.ets import prompt from '@system.prompt' @Entry