未验证 提交 e8ebd7ee 编写于 作者: O openharmony_ci 提交者: Gitee

!11478 js文档整改

Merge pull request !11478 from 田雨/master
...@@ -101,26 +101,28 @@ ...@@ -101,26 +101,28 @@
headericon="/common/search.svg" placeholder="Please input text" onchange="change" headericon="/common/search.svg" placeholder="Please input text" onchange="change"
onenterkeyclick="enterkeyClick"> onenterkeyclick="enterkeyClick">
</input> </input>
<input class="button" type="button" value="Submit" onclick="buttonClick"></input> <input class="button" type="button" value="Submit" onclick="buttonClick" style="color: blue"></input>
</div> </div>
``` ```
```css ```css
/* xxx.css */ /* xxx.css */
.content { .content {
width: 60%; width: 100%;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.input { .input {
width: 60%;
placeholder-color: gray; placeholder-color: gray;
} }
.button { .button {
width: 60%;
background-color: gray; background-color: gray;
margin-top: 20px; margin-top: 20px;
} }
``` ```
```js ```js
// xxx.js // xxx.js
import prompt from '@system.prompt' import prompt from '@system.prompt'
...@@ -142,9 +144,10 @@ ...@@ -142,9 +144,10 @@
error: 'error text' error: 'error text'
}); });
}, },
} }
``` ```
![zh-cn_image_0000001252835901](figures/zh-cn_image_0000001252835901.png) ![zh-cn_image_0000001252835901](figures/zh-cn_image_0000001252835901.png)
2. type为button 2. type为button
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
/*xxx.css */ /*xxx.css */
.container { .container {
flex-direction: column; flex-direction: column;
align-items: center; margin-left: 20px;
} }
.row { .row {
flex-direction: row; flex-direction: row;
......
...@@ -58,8 +58,6 @@ ...@@ -58,8 +58,6 @@
<div class="container"> <div class="container">
<qrcode value="{{qr_value}}" type="{{qr_type}}" <qrcode value="{{qr_value}}" type="{{qr_type}}"
style="color: {{qr_col}};background-color: {{qr_bcol}};width: {{qr_size}};height: {{qr_size}};margin-bottom: 70px;"></qrcode> style="color: {{qr_col}};background-color: {{qr_bcol}};width: {{qr_size}};height: {{qr_size}};margin-bottom: 70px;"></qrcode>
<text class="txt">Value</text>
<input onChange="setValue">123</input>
<text class="txt">Type</text> <text class="txt">Type</text>
<switch showtext="true" checked="true" texton="rect" textoff="circle" onchange="settype"></switch> <switch showtext="true" checked="true" texton="rect" textoff="circle" onchange="settype"></switch>
<text class="txt">Color</text> <text class="txt">Color</text>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
### getContext ### getContext
getContext(type: '2d', options?: ContextAttrOptions): CanvasRendering2dContext getContext(type: '2d', options?: ContextAttrOptions): CanvasRenderingContext2D
获取canvas绘图上下文。不支持在onInit和onReady中进行调用。 获取canvas绘图上下文。不支持在onInit和onReady中进行调用。
......
...@@ -319,7 +319,7 @@ Page1有一个不透明盒子,点击盒子会跳转到Page2,当点击Page2 ...@@ -319,7 +319,7 @@ Page1有一个不透明盒子,点击盒子会跳转到Page2,当点击Page2
<div class="container"> <div class="container">
<text>transition</text> <text>transition</text>
<div class="move_page" onclick="jumpBack"></div> <div class="move_page" onclick="jumpBack"></div>
</div </div>
``` ```
```js ```js
......
...@@ -62,16 +62,16 @@ ...@@ -62,16 +62,16 @@
除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件: 除支持[通用事件](../arkui-js/js-components-common-events.md)外,还支持如下事件:
| 名称 | 参数 | 描述 | | 名称 | 参数 | 描述 |
| -------------------------- | ---------------------------------------- | ---------------------------------------- | | -------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| indexerchange<sup>5+</sup> | {&nbsp;local:&nbsp;booleanValue&nbsp;} | 多语言索引条切换事件,仅当indexer属性为true,indexermulti为true时生效。booleanValue可能值为true或者false:<br/>-&nbsp;true:&nbsp;当前展示本地索引。<br/>-&nbsp;false:&nbsp;当前展示字母索引。 | | indexerchange<sup>5+</sup> | {&nbsp;local:&nbsp;booleanValue&nbsp;} | 多语言索引条切换事件,仅当indexer属性为true,indexermulti为true时生效。booleanValue可能值为true或者false:<br/>-&nbsp;true:&nbsp;当前展示本地索引。<br/>-&nbsp;false:&nbsp;当前展示字母索引。 |
| scroll | {&nbsp;scrollX:&nbsp;scrollXValue,&nbsp;scrollY:&nbsp;scrollYValue,&nbsp;scrollState:&nbsp;stateValue&nbsp;} | 列表滑动的偏移量和状态回调。<br/>stateValue:&nbsp;0表示列表滑动已经停止。<br/>stateValue:&nbsp;1表示列表正在用户触摸状态下滑动。<br/>stateValue:&nbsp;2表示列表正在用户松手状态下滑动。 | | scroll | {&nbsp;scrollX:&nbsp;scrollXValue,&nbsp;scrollY:&nbsp;scrollYValue,&nbsp;scrollState:&nbsp;stateValue&nbsp;} | 列表滑动的偏移量和状态回调。<br/>stateValue:&nbsp;0表示列表滑动已经停止。<br/>stateValue:&nbsp;1表示列表正在用户触摸状态下滑动。<br/>stateValue:&nbsp;2表示列表正在用户松手状态下滑动。 |
| scrollbottom | - | 当前列表已滑动到底部位置。 | | scrollbottom | - | 当前列表已滑动到底部位置。 |
| scrolltop | - | 当前列表已滑动到顶部位置。 | | scrolltop | - | 当前列表已滑动到顶部位置。 |
| scrollend | - | 列表滑动已经结束。 | | scrollend | - | 列表滑动已经结束。 |
| scrolltouchup | - | 手指已经抬起且列表仍在惯性滑动。 | | scrolltouchup | - | 手指已经抬起且列表仍在惯性滑动。 |
| requestitem | - | 请求创建新的list-item。<br/>长列表延迟加载时,可视区域外缓存的list-item数量少于cachedcount时,会触发该事件。 | | requestitem | - | 请求创建新的list-item。<br/>长列表延迟加载时,可视区域外缓存的list-item数量少于cachedcount时,会触发该事件。 |
| rotate<sup>7+</sup> | {&nbsp;rotateValue:&nbsp;number&nbsp;} | 返回表冠旋转角度增量值,仅智能穿戴支持。 | | rotation<sup>7+</sup> | {&nbsp;rotateValue:&nbsp;number&nbsp;} | 返回表冠旋转角度增量值,仅智能穿戴支持。 |
## 方法 ## 方法
......
...@@ -5,15 +5,6 @@ ...@@ -5,15 +5,6 @@
> >
> - 从API version 4开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > - 从API version 4开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
> >
> - 需要在config.json对应的"abilities"中设置"configChanges"属性为"orientation"
> ```
> "abilities": [
> {
> "configChanges": ["orientation"],
> ...
> }
> ]
> ```
视频播放组件。 视频播放组件。
......
...@@ -133,17 +133,18 @@ onBreakpointChange(callback: (breakpoints: string) => void) ...@@ -133,17 +133,18 @@ onBreakpointChange(callback: (breakpoints: string) => void)
struct GridRowExample { struct GridRowExample {
@State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown] @State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown]
@State currentBp: string = 'unknown' @State currentBp: string = 'unknown'
build() { build() {
Column() { Column() {
GridRow({ GridRow({
columns: 5, columns: 5,
gutter: {x:5, y:10}, gutter: { x: 5, y: 10 },
breakpoints: {value:["400vp", "600vp", "800vp"], breakpoints: { value: ["400vp", "600vp", "800vp"],
reference: BreakpointsReference.WindowSize}, reference: BreakpointsReference.WindowSize },
direction: GridRowDirection.Row direction: GridRowDirection.Row
}) { }) {
ForEach(this.bgColors, (color)=>{ ForEach(this.bgColors, (color) => {
GridCol({ span: {xs:1, sm:2, md:3, lg:4}}) { GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 } }) {
Row().width("100%").height("20vp") Row().width("100%").height("20vp")
}.borderColor(color).borderWidth(2) }.borderColor(color).borderWidth(2)
}) })
...@@ -151,8 +152,8 @@ struct GridRowExample { ...@@ -151,8 +152,8 @@ struct GridRowExample {
.onBreakpointChange((breakpoint) => { .onBreakpointChange((breakpoint) => {
this.currentBp = breakpoint this.currentBp = breakpoint
}) })
}.width('80%').margin({ left: 10,top: 5, bottom:5 }).height(200) }.width('80%').margin({ left: 10, top: 5, bottom: 5 }).height(200)
.border({color:Color.Blue, width:2}) .border({ color: '#880606', width: 2 })
} }
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册