add range functionality
This commit is contained in:
parent
0cc42a3ee4
commit
d08edaa007
@ -92,11 +92,18 @@ export default {
|
||||
}
|
||||
this.$store.state.arrayresultchaines = [];
|
||||
const arraychaine = [...new Set(this.chaine.split(" "))];
|
||||
|
||||
const re = new RegExp("^[0-9]*-[0-9]*$");
|
||||
arraychaine.forEach(element => {
|
||||
if (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});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
parsechaine() {
|
||||
|
Loading…
Reference in New Issue
Block a user