提交 82d398ba 编写于 作者: T tianyu

update lottie and animation

Signed-off-by: Ntianyu <tianyu55@h-partners.com>
上级 37f96289
......@@ -122,7 +122,6 @@ off(type: 'change', callback?: Callback&lt;MediaQueryResult&gt;): void
```ts
import mediaquery from '@ohos.mediaquery'
let portraitFunc = null
@Entry
@Component
......@@ -142,7 +141,7 @@ struct MediaQueryExample {
}
aboutToAppear() {
portraitFunc = this.onPortrait.bind(this) //bind current js instance
let portraitFunc = this.onPortrait.bind(this) //bind current js instance
this.listener.on('change', portraitFunc)
}
......
......@@ -18,7 +18,10 @@ import lottie from '@ohos/lottieETS'
```
> **说明:**
>
> 在Terminal窗口使用 `npm install @ohos/lottieETS` 命令下载Lottie,下载之前需要配置权限。
>
> 安装ohos npm 三方包时,需要先执行`npm config set @ohos:registry=https://repo.harmonyos.com/npm/`设置仓库地址。
## lottie.loadAnimation
......
......@@ -69,16 +69,12 @@ PageTransitionEnter和PageTransitionExit组件支持的事件:
struct PageTransitionExample1 {
@State scale1: number = 1
@State opacity1: number = 1
@State active: boolean = false
build() {
Column() {
Navigator({ target: 'pages/page1', type: NavigationType.Push }) {
Image($r('app.media.bg1')).width("100%").height("100%")
}
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale1 }).opacity(this.opacity1)
}
// 自定义方式1:完全自定义转场过程的效果
......@@ -104,7 +100,6 @@ struct PageTransitionExample1 {
struct AExample {
@State scale2: number = 1
@State opacity2: number = 1
@State active: boolean = false
build() {
Column() {
......@@ -140,16 +135,12 @@ struct AExample {
struct PageTransitionExample {
@State scale1: number = 1
@State opacity1: number = 1
@State active: boolean = false
build() {
Column() {
Navigator({ target: 'pages/page1', type: NavigationType.Push }) {
Image($r('app.media.bg1')).width("100%").height("100%")
}
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale1 }).opacity(this.opacity1)
}
......@@ -171,16 +162,12 @@ struct PageTransitionExample {
struct PageTransitionExample1 {
@State scale2: number = 1
@State opacity2: number = 1
@State active: boolean = false
build() {
Column() {
Navigator({ target: 'pages/index', type: NavigationType.Push }) {
Image($r('app.media.bg2')).width ("100%").height("100%")
}
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale2 }).opacity(this.opacity2)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册