提交 0dd4d4c7 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

更新 iOS 示例

上级 18932063
...@@ -80,15 +80,15 @@ ...@@ -80,15 +80,15 @@
watch: { watch: {
"path": { "path": {
handler(newValue: string, oldValue: string) { handler(newValue: string, oldValue: string) {
this.path = newValue if (this.autoplay) {
this.playAnimation() this.playAnimation()
}
}, },
immediate: false //创建时是否通过此方法更新属性,默认值为false immediate: false //创建时是否通过此方法更新属性,默认值为false
}, },
"loop": { "loop": {
handler(newValue: boolean, oldValue: boolean) { handler(newValue: boolean, oldValue: boolean) {
this.loop = newValue if (newValue) {
if (this.loop) {
this.$el.loopMode = LottieLoopMode.loop this.$el.loopMode = LottieLoopMode.loop
} else { } else {
this.$el.loopMode = LottieLoopMode.playOnce this.$el.loopMode = LottieLoopMode.playOnce
...@@ -98,8 +98,7 @@ ...@@ -98,8 +98,7 @@
}, },
"autoplay": { "autoplay": {
handler(newValue: boolean, oldValue: boolean) { handler(newValue: boolean, oldValue: boolean) {
this.autoplay = newValue if (newValue) {
if (this.autoplay) {
this.playAnimation() this.playAnimation()
} }
}, },
...@@ -108,9 +107,7 @@ ...@@ -108,9 +107,7 @@
"action": { "action": {
handler(newValue: string, oldValue: string) { handler(newValue: string, oldValue: string) {
const action = newValue const action = newValue
if (action == "play" || action == "pause" || action == "stop") { if (action == "play" || action == "pause" || action == "stop") {
this.action = action
switch (action) { switch (action) {
case "play": case "play":
this.playAnimation() this.playAnimation()
...@@ -133,7 +130,6 @@ ...@@ -133,7 +130,6 @@
"hidden": { "hidden": {
handler(newValue: boolean, oldValue: boolean) { handler(newValue: boolean, oldValue: boolean) {
this.hidden = newValue
this.$el.isHidden = this.hidden this.$el.isHidden = this.hidden
}, },
immediate: false //创建时是否通过此方法更新属性,默认值为false immediate: false //创建时是否通过此方法更新属性,默认值为false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册