fix: rework setup to improve SSR compatibility

This commit is contained in:
Anthony Fu 2022-12-28 02:06:54 +01:00
parent fd7d30a38a
commit d8d163dbd0
22 changed files with 137 additions and 73 deletions

View file

@ -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,
})
}