提交 243ecd50 编写于 作者: T tianyu

update docs

Signed-off-by: Ntianyu <tianyu55@h-partners.com>
上级 acea059c
......@@ -133,7 +133,7 @@ back(options?: RouterOptions ): void
**示例:**
```js
router.back({uri:'pages/detail'});
router.back({url:'pages/detail'});
```
## router.clear
......@@ -313,7 +313,7 @@ export default {
// 在detail页面中
export default {
onInit() {
console.info('showData1:' + router.getParams().data1);
console.info('showData1:' + router.getParams()[data1]);
}
}
```
......
......@@ -22,7 +22,7 @@ addColorStop(offset: number, color: string): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
<input type="button" style="width: 180px; height: 60px;" value="fillStyle"onclick="handleClick" />
</div>
```
......
......@@ -21,7 +21,7 @@ addPath(path: Object): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -61,7 +61,7 @@ setTransform(scaleX: number, skewX: number, skewY: number, scaleY: number, trans
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -91,7 +91,7 @@ closePath(): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -130,7 +130,7 @@ moveTo(x: number, y: number): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 300px; height: 250px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 300px; height: 250px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -169,7 +169,7 @@ lineTo(x: number, y: number): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 400px; height: 450px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 400px; height: 450px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -213,7 +213,7 @@ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number,
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -252,7 +252,7 @@ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -293,7 +293,7 @@ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number,
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -332,7 +332,7 @@ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 200px; height: 150px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -374,7 +374,7 @@ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 500px; height: 450px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 500px; height: 450px; background-color: #ffff00;"></canvas>
</div>
```
......@@ -412,7 +412,7 @@ rect(x: number, y: number, width: number, height: number): void
```html
<!-- xxx.hml -->
<div>
<canvas ref="canvas" style="width: 500px; height: 450px; background-color: #ffff00;"</canvas>
<canvas ref="canvas" style="width: 500px; height: 450px; background-color: #ffff00;"></canvas>
</div>
```
......
......@@ -234,8 +234,8 @@ struct ImageExample2 {
@Entry
@Component
struct ImageExample3 {
@State width: number = 0
@State height: number = 0
@State widthValue: number = 0
@State heightValue: number = 0
private on: Resource = $r('app.media.image_on')
private off: Resource = $r('app.media.image_off')
private on2off: Resource = $r('app.media.image_on2off')
......@@ -256,8 +256,8 @@ struct ImageExample3 {
.height(180).width(180)
// 图片加载完成后,获取图片尺寸。
.onComplete((msg: { width: number,height: number }) => {
this.width = msg.width
this.height = msg.height
this.widthValue = msg.width
this.heightValue = msg.height
})
.onError(() => {
console.log('load image fail')
......
......@@ -61,13 +61,15 @@ struct RemoteWindowExample {
@State target: WindowAnimationTarget = undefined // 通过windowAnimationManager获取
build() {
RemoteWindow(this.target)
.translate({x:100, y:200})
.scale({x:0.5, y:0.5})
Column() {
RemoteWindow(this.target)
.translate({x:100, y:200})
.scale({x:0.5, y:0.5})
.opacity(0.8)
.position({x:px2vp(this.target?.windowBounds.left), y:px2vp(this.target?.windowBounds.top)})
.width(px2vp(this.target?.windowBounds.width))
.height(px2vp(this.target?.windowBounds.height))
.position({x:px2vp(this.target?.windowBounds.left), y:px2vp(this.target?.windowBounds.top)})
.width(px2vp(this.target?.windowBounds.width))
.height(px2vp(this.target?.windowBounds.height))
}
}
}
```
\ No newline at end of file
......@@ -46,21 +46,21 @@ PinchGesture(options?: { fingers?: number, distance?: number })
@Entry
@Component
struct PinchGestureExample {
@State scale: number = 1
@State scaleValue: number = 1
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
Text('PinchGesture scale:' + this.scale)
}
.height(100).width(200).padding(20).border({ width: 1 }).margin(80)
.scale({ x: this.scale, y: this.scale, z: this.scale })
.scale({ x: this.scaleValue, y: this.scaleValue, z: this.scaleValue })
.gesture(
PinchGesture()
.onActionStart((event: GestureEvent) => {
console.info('Pinch start')
})
.onActionUpdate((event: GestureEvent) => {
this.scale = event.scale
this.scaleValue = event.scale
})
.onActionEnd(() => {
console.info('Pinch end')
......
......@@ -40,10 +40,10 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F
| ColumnReverse | 与Column相反方向进行布局。 |
- FlexWrap枚举说明
| 名称 | 描述 |
| ----------- | --------------------------- |
| NoWrap | Flex容器的元素单行/列布局,子项允许超出容器。 |
| Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 |
| 名称 | 描述 |
| ----------- | ------------------------------------------------- |
| NoWrap | Flex容器的元素单行/列布局,子项允许超出容器。 |
| Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 |
| WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 |
- FlexAlign枚举说明
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册