You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
723 B
33 lines
723 B
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
|
|
}
|
|
}
|
|
}
|
|
|