fix: rework setup to improve SSR compatibility
This commit is contained in:
parent
fd7d30a38a
commit
d8d163dbd0
22 changed files with 137 additions and 73 deletions
|
@ -9,12 +9,13 @@ const emit = defineEmits<{
|
|||
|
||||
const el = $ref<HTMLElement>()
|
||||
let picker = $ref<Picker>()
|
||||
const colorMode = useColorModeRef()
|
||||
|
||||
async function openEmojiPicker() {
|
||||
await updateCustomEmojis()
|
||||
if (picker) {
|
||||
picker.update({
|
||||
theme: isDark.value ? 'dark' : 'light',
|
||||
theme: colorMode.value,
|
||||
custom: customEmojisData.value,
|
||||
})
|
||||
}
|
||||
|
@ -28,7 +29,7 @@ async function openEmojiPicker() {
|
|||
? emit('select', native)
|
||||
: emit('selectCustom', { src, alt, 'data-emoji-id': name })
|
||||
},
|
||||
theme: isDark.value ? 'dark' : 'light',
|
||||
theme: colorMode.value,
|
||||
custom: customEmojisData.value,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue