Browse Source

修改k线不能一直加载数据问题

master
liaoxinyu 2 years ago
parent
commit
0e20fc793b
  1. 12
      src/views/option/kline.vue

12
src/views/option/kline.vue

@ -240,13 +240,13 @@ methods: {
) {
// handleClick
this.page[this.symbol] = this.page[this.symbol] || 1;
let page = this.page[this.symbol] > 3 ? 3 : this.page[this.symbol];
let page = this.page[this.symbol] > 50 ? 50 : this.page[this.symbol];
let data = {
symbol: this.ajaxTv.getSymbol(symbolInfo.name),
period: this.resolution(resolution),
form: rangeStartDate,
to: rangeEndDate,
size: page * 200,
size: page * 400,
zip: 1,
};
@ -268,14 +268,14 @@ methods: {
this.timer = resolution;
this.ajaxTv.getKline(data).then((res) => {
let arr = this.unzip(res.data).map((item) => {
return this.getMap(item);
return this.getMap(item);
});
this.page[this.symbol]++;
onLoadedCallback(arr);
setTimeout(() => {
if (this.page[this.symbol] > 3) {
onLoadedCallback([]);
}
if (this.page[this.symbol] > 50) {
onLoadedCallback([]);
}
}, 60);
});
//

Loading…
Cancel
Save