初始化渲染动画
通过给Animate
组件指定a:appear={true}
属性,可以设置元素初始化渲染时的动画。和enter/leave动画一样它将添加animate-appear & animate-appear-active
类名,并且触发a:appearStart & a:appear & a:appearEnd
事件。
<Animate a:appear={true} class="appear">appear</Animate>
.appear {
display: inline-block;
padding: 10px;
border: 1px solid #eee;
}
.animate-appear {
transform: scale(0.01);
}
.animate-appear-active {
transition: all 1s;
}
var Component = Intact.extend({
template: template
});
定义一个组件来操作上述Component
的挂载:
var C = Intact.extend({
template: '<button ev-click={self.append.bind(self)}\
style="display: block">挂载Component</button>',
append: function() {
Intact.mount(Component, document.getElementById('app'));
}
});
Intact.mount(C, document.getElementById('app'));