1) 修改tabpage 第一次不加载
This commit is contained in:
parent
81c632cca4
commit
0866805d51
|
@ -228,7 +228,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
plan_id: "",
|
plan_id: "",
|
||||||
key_batch_id: "",
|
key_batch_id: "",
|
||||||
title: "",
|
title: "",
|
||||||
date_time: "",
|
date_time: JSON.parse(sessionStorage.getItem("datetime")),
|
||||||
});
|
});
|
||||||
const form_info_el = useRef(null);
|
const form_info_el = useRef(null);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,25 @@ export default class tabbar extends React.Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.tabChange(0);
|
if (this.props.first) {
|
||||||
|
this.setState({ activeIndex: 0 });
|
||||||
|
let arr = [];
|
||||||
|
for (let i = 0; i < this.state.tabList.length; i++) {
|
||||||
|
let temp = this.state.tabList[i];
|
||||||
|
if (i == 0) {
|
||||||
|
temp.className = "tabbar active";
|
||||||
|
} else if (i == 0 - 1) {
|
||||||
|
temp.className = "tabbar none-border";
|
||||||
|
} else {
|
||||||
|
temp.className = "tabbar";
|
||||||
|
}
|
||||||
|
arr[i] = temp;
|
||||||
|
}
|
||||||
|
this.setState({ tabList: arr });
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
this.tabChange(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tabChange(index) {
|
tabChange(index) {
|
||||||
|
@ -33,7 +51,7 @@ export default class tabbar extends React.Component {
|
||||||
arr[i] = temp;
|
arr[i] = temp;
|
||||||
}
|
}
|
||||||
this.setState({ tabList: arr });
|
this.setState({ tabList: arr });
|
||||||
if (this.state.tabList.length > 1 && this.props.first !== true) {
|
if (this.state.tabList.length > 1) {
|
||||||
this.props.tabChange(index);
|
this.props.tabChange(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,7 +193,6 @@ const UseCouponList = () => {
|
||||||
const selectionFun = () => {};
|
const selectionFun = () => {};
|
||||||
const searchCallback = () => {
|
const searchCallback = () => {
|
||||||
setState({ isQuery: !state.isQuery });
|
setState({ isQuery: !state.isQuery });
|
||||||
// getTable();
|
|
||||||
};
|
};
|
||||||
const onPageChange = (data) => {
|
const onPageChange = (data) => {
|
||||||
setState({ page: data, isQuery: !state.isQuery });
|
setState({ page: data, isQuery: !state.isQuery });
|
||||||
|
|
Loading…
Reference in New Issue