-
Iuap 5.0表单布局参照通用 UI 版本附件上传反馈
版权所有:用友网络科技股份有限公司 2017 京ICP备05007539号-7 京ICP证100714号 京公网安备1101080209224号
Powered by yonyou
/**
*
* @title 多页签组件
* @description 基于应用平台
*
*/
import React, { Component } from 'react';
import {Button} from 'tinper-bee';
import AcMultiTabs from 'ac-multi-tabs';
let index = 0;
class Demo1 extends Component {
constructor(props){
super(props);
this.state = {
menus: [{
id: 0,
router: 'home',
title: "home"
}]
}
}
// 增加
add = (e) => {
e.stopPropagation();
++index;
const newTab = {
id: index++ ,
title: `节点: ${index}`,
router: `/节点: ${index}`,
};
this.setState({
menus: this.state.menus.concat(newTab),
});
}
handleChange = (v) => {
console.log(v)
this.setState({
menus : v
})
}
render () {
const { menus } = this.state;
return (
<div className="demoPadding">
<Button colors="primary" onClick={this.add} style={{margin: '8px'}}>增加</Button>
<AcMultiTabs menus={menus} onChange={this.handleChange}/>
</div>
)
}
}