add range functionality
This commit is contained in:
parent
0cc42a3ee4
commit
d08edaa007
@ -92,10 +92,17 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$store.state.arrayresultchaines = [];
|
this.$store.state.arrayresultchaines = [];
|
||||||
const arraychaine = [...new Set(this.chaine.split(" "))];
|
const arraychaine = [...new Set(this.chaine.split(" "))];
|
||||||
|
const re = new RegExp("^[0-9]*-[0-9]*$");
|
||||||
arraychaine.forEach(element => {
|
arraychaine.forEach(element => {
|
||||||
if (element != "") {
|
if (element != "") {
|
||||||
this.$store.dispatch('getchaine',{num:element});
|
if(re.test(element)){
|
||||||
|
var range=element.split("-")
|
||||||
|
for (var i = range[0]; i <= range[1]; i++) {
|
||||||
|
this.$store.dispatch('getchaine',{num:i});
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.$store.dispatch('getchaine',{num:element});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user