-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
43 lines (42 loc) · 1.03 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { createApp } = Vue
createApp({
data() {
return {
wavs: [],
amount: 1,
outputString: '',
inputTxt: ''
}
},
methods: {
addWavs: function() {
for (var i = 0; i < this.amount; i++){
this.wavs.push('')
}
},
outputTxt() {
var outputString = ''
this.wavs.forEach(function(wav, index){
outputString += `wavs/${index+1}.wav|${wav}\n`
})
this.outputString = outputString
return outputString
},
saveTxt() {
var a = document.getElementById("download");
var file = new Blob([this.outputString], {type: 'text/json'});
a.href = URL.createObjectURL(file);
a.download = 'list.txt';
},
importTxt() {
var wavs = []
console.log(this.inputTxt)
this.inputTxt.split('\n').forEach(function(wav) {
if (wav != ''){
wavs.push( wav.split('|')[1])
}
})
this.wavs = wavs
}
}
}).mount('#app')