image-viewer.wxs 228 B

1234567
  1. function shouldLoadImage(index, currentIndex, loadedIndexes) {
  2. return Math.abs(index - currentIndex) <= 1 || (loadedIndexes && loadedIndexes.indexOf(index) !== -1);
  3. }
  4. module.exports = {
  5. shouldLoadImage: shouldLoadImage,
  6. };