-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathuseEmojiItem.ts
More file actions
17 lines (15 loc) Β· 635 Bytes
/
useEmojiItem.ts
File metadata and controls
17 lines (15 loc) Β· 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { onBeforeUnmount, onMounted, ref } from 'vue'
import type { Ref } from 'vue'
const emojiArr = ['π', 'π', 'π', 'ποΈ', 'π«', 'π·', 'π‘', 'π§±', 'π', 'β‘οΈ', 'β»οΈ', 'π§', 'β¨', 'π¨', 'π·οΈ', 'π', 'π', 'π', 'π', 'β
', 'π', 'π¦οΈ']
export function useEmojiItem(): Ref<string> {
const emoji = ref('β¨')
onMounted(() => {
const interval = setInterval(() => {
emoji.value = emojiArr[Math.floor(Math.random() * emojiArr.length)]
}, 340)
onBeforeUnmount(() => {
clearInterval(interval)
})
})
return emoji
}