|
@@ -10,7 +10,7 @@ export default React.forwardRef((props, ref) => {
|
10
|
10
|
const { sid, request, params, renderItem, onLoadingChange, onDataChange } = props;
|
11
|
11
|
|
12
|
12
|
const pageSize = 5;
|
13
|
|
- const pageShowRef = React.useRef(false);
|
|
13
|
+ const pageShowRef = React.useRef(true);
|
14
|
14
|
const [loading, setLoading] = React.useState(false);
|
15
|
15
|
const [list, setList] = React.useState([]);
|
16
|
16
|
const [finished, setFinished] = React.useState(true);
|
|
@@ -105,18 +105,18 @@ export default React.forwardRef((props, ref) => {
|
105
|
105
|
if (pageShowRef.current) {
|
106
|
106
|
refresh(params);
|
107
|
107
|
}
|
108
|
|
- }, [params]);
|
|
108
|
+ }, [params, sid]);
|
109
|
109
|
|
110
|
110
|
React.useImperativeHandle(ref, () => ({
|
111
|
111
|
refresh: () => refresh(params),
|
112
|
112
|
updateData: (dt) => setList(dt),
|
113
|
|
- }), [params]);
|
|
113
|
+ }), [params, sid]);
|
114
|
114
|
|
115
|
115
|
React.useEffect(() => {
|
116
|
116
|
return () => {
|
117
|
117
|
Taro.removeStorageSync(`list-${sid}`);
|
118
|
118
|
}
|
119
|
|
- }, []);
|
|
119
|
+ }, [sid]);
|
120
|
120
|
|
121
|
121
|
return (
|
122
|
122
|
<PowerScrollView
|