# 添加与删除 - order: 5 场景里有增加或删除条目时也会触发动画。 --- ````jsx import { QueueAnim, Button } from 'antd'; const Test = React.createClass({ getInitialState() { return { show: true, items: [
  • ,
  • ,
  • ], }; }, onClick() { this.setState({ show: !this.state.show, }); }, onAdd() { let items = this.state.items; items.push(
  • ); this.setState({ show: true, items: items, }); }, onRemove() { let items = this.state.items; items.splice(items.length - 1, 1); this.setState({ show: true, items: items, }); }, render() { return (

    {this.state.show ? this.state.items : null}
    ); } }); ReactDOM.render(, document.getElementById('components-queue-anim-demo-change')); ````