ember 液体茶 transitions.js

ember liquid-teather transitions.js

我正在使用 ember 液体茶水 - http://pzuraq.github.io/liquid-tether/#/examples?a=animation-with-context

我使用的代码来自'Animation With Context'下的示例。

模式有效,但没有很好的过渡,因为我在 transitions.js 文件的控制台中收到错误。

查看下面的转换代码:

export default function(){
  this.transition(
    target('modal-dialog'),
    this.toValue(({ index: newIndex }, { index: oldIndex }) => newIndex > oldIndex),
    this.use('tether', ['to-left', options]),
    this.reverse('tether', ['to-right', options])
  );

  this.transition(
    target('modal-dialog'),
    this.toValue(({ index }) => index === 1),
    this.use('tether', 'fade', 'fade')
  );

  this.transition(
    target('modal-dialog'),
    this.toValue(({ index }) => !index),
    this.use('tether', 'fade', 'fade')
  );
}

错误是:目标未定义。

如何定义目标?

提前致谢! :-)

从头开始!我已经解决了我自己的问题。我只需要在 transitions.js 文件的顶部声明它。

import { target } from 'liquid-tether';

但现在我遇到的问题是 'options not define'。 ...有什么想法吗?

您可以在此处查看选项允许的值。 http://tether.io/ 在选项下搜索 :).

options 未定义是指您传递给动画的选项。从文档中不是很清楚,但它期望这里有一个选项散列。例如:

this.use('tether', ['to-left', {duration: 500}]),

查看液体火场以了解所有可用于动画的选项