我想使用neon-animated-pages切换页面
所以我的代码很简单:
<dom-module id="auth-view">
<template>
<style>
</style>
<neon-animated-pages class="neon-container" selected="[[selected]]">
<login-page></login-page>
<pwd-reset-page></pwd-reset-page>
</neon-animated-pages>
</template>
</dom-module>在dart代码中:
@property
int selected = 0;
StreamSubscription _clickSubscription;
attached() {
_clickSubscription = this.on['showPwdReset'].listen((e) {
e = convertToDart(e);
// Read things from `e`.
print("Got show Event!");
selected = 1;
});
}所以,我捕捉到了事件--我可以在控制台中看到它。但是页面不会改变。
我仍然可以通过在shadow-dom中添加选定内容来手动更改它。
有什么问题吗?
发布于 2017-01-29 04:23:50
页面项目应该使用<neon-animatable>进行包装,如下所示:
<neon-animatable><login-page></login-page></neon-animatable>
<neon-animatable><pwd-reset-page></pwd-reset-page></neon-animatable>有关更多信息,请访问https://www.webcomponents.org/element/PolymerElements/neon-animation/neon-animatable
https://stackoverflow.com/questions/41905626
复制相似问题