Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

perf: asynchronously load the emoji data of the comment reply component #798

Merged
merged 1 commit into from
Dec 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {
} from "@halo-dev/api-client";
// @ts-ignore
import { Picker } from "emoji-mart";
import data from "@emoji-mart/data";
import i18n from "@emoji-mart/data/i18n/zh.json";
import { computed, nextTick, ref, watch, watchEffect } from "vue";
import { reset } from "@formkit/core";
Expand Down Expand Up @@ -120,7 +119,10 @@ const emojiPickerRef = ref<HTMLElement | null>(null);

const handleCreateEmojiPicker = () => {
const emojiPicker = new Picker({
data: data,
data: async () => {
const data = await import("@emoji-mart/data");
return Object.assign({}, data);
},
theme: "light",
autoFocus: true,
i18n: i18n,
Expand Down