未验证 提交 30a23eb2 编写于 作者: RsShare's avatar RsShare 提交者: Gitee

update zh-cn/application-dev/reference/arkui-ts/ts-methods-menu.md. 修改代码格式

修改代码格式
Signed-off-by: RsShare's avatarzqq00163 <zqq00163@163.com>
上级 b0252810
...@@ -12,30 +12,30 @@ ...@@ -12,30 +12,30 @@
- 示例 - 示例
``` ```
// xxx.ets
@Entry @Entry
@Component @Component
struct Index { struct Index {
@Builder MenuBuilder(){ @Builder MenuBuilder() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('close') Text('close')
.fontSize(30) .fontSize(30)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
.onClick(() => { .onClick(() => {
ContextMenu.close(); ContextMenu.close();
}) })
}.height(400) }.height(400)
.backgroundColor(Color.Pink) .backgroundColor(Color.Pink)
} }
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) { build() {
Column(){ Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start, justifyContent: FlexAlign.Start }) {
Text("Text") Column() {
}.bindContextMenu(this.MenuBuilder, ResponseType.LongPress) Text("Text")
} }.bindContextMenu(this.MenuBuilder, ResponseType.LongPress)
.width('100%')
.height('100%')
} }
.width('100%')
.height('100%')
} }
}
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册