forked from dcloudio/uni-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build uni runtime(refactor previewImage)
- Loading branch information
Showing
11 changed files
with
141 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
src/platforms/mp-weixin/helpers/normalize-preview-image-args.js
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
src/platforms/mp-weixin/helpers/normalize-preview-image.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export default { | ||
args (fromArgs) { | ||
let currentIndex = parseInt(fromArgs.current) | ||
if (isNaN(currentIndex)) { | ||
return | ||
} | ||
const urls = fromArgs.urls | ||
if (!Array.isArray(urls)) { | ||
return | ||
} | ||
const len = urls.length | ||
if (!len) { | ||
return | ||
} | ||
if (currentIndex < 0) { | ||
currentIndex = 0 | ||
} else if (currentIndex >= len) { | ||
currentIndex = len - 1 | ||
} | ||
if (currentIndex > 0) { | ||
fromArgs.current = urls[currentIndex] | ||
fromArgs.urls = urls.filter( | ||
(item, index) => index < currentIndex ? item !== urls[currentIndex] : true | ||
) | ||
} else { | ||
fromArgs.current = urls[0] | ||
} | ||
return { | ||
indicator: false, | ||
loop: false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,6 @@ | ||
import normalizePreviewImageArgs from '../../helpers/normalize-preview-image-args' | ||
import previewImage from '../../helpers/normalize-preview-image' | ||
export const protocols = { | ||
previewImage: { | ||
args (fromArgs) { | ||
normalizePreviewImageArgs(fromArgs) | ||
return { | ||
indicator: false, | ||
loop: false | ||
} | ||
} | ||
} | ||
previewImage | ||
} | ||
export const todos = [] | ||
export const canIUses = [] |