Skip to content

Commit

Permalink
替换打字机显示表情、解决出现?图标问题
Browse files Browse the repository at this point in the history
  • Loading branch information
onresize committed Jul 8, 2024
1 parent a107689 commit e52597e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/.vuepress/utils/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@
// }).print();

const autoWriting = (index = 0) => {
let str = 'Hi there 👋, Welcome to my blog!'
let str = 'Hi there , Welcome to my blog!'
const dom = document.getElementById('main-title')
let ret = ''
if (index < str.length) {
ret += str[index]
if (!dom?.innerHTML) return
dom.innerHTML += ret
// ret += str[index]
ret += str.charAt(index)
if (!dom?.textContent) return
dom.textContent += ret
setTimeout(autoWriting, 80, ++index)
}
}
Expand Down

0 comments on commit e52597e

Please sign in to comment.