Open 2439905184 opened 1 year ago
<p id="dialog"></p> <script> var dialog = document.getElementById("dialog") var text="a sentence" var text2="测试 程序也" var character_array = text2.split("") console.log(character_array) var ch_index = 0 var ch_wait_time = 1000 // dialog.innerText += character_array[0] + character_array[1] + character_array[2] // dialog.innerText = character_array[0] // var s="a"+" " +"s" // console.log(s) var timer = setInterval(()=> { console.log(character_array[ch_index]) dialog.innerText += character_array[ch_index] if(character_array[ch_index] == ' ') { dialog.innerText += '\xa0' } ch_index+= 1 if(ch_index == character_array.length) { clearInterval(this.timer) } },ch_wait_time)
在新的重写引擎框架里面:vue-gal