mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-26 11:38:15 +08:00
17 lines
442 B
TypeScript
17 lines
442 B
TypeScript
import { icons } from '@internal/iconify'
|
|
import { ref } from 'vue'
|
|
import type { Ref } from 'vue'
|
|
|
|
type IconsData = Record<string, string>
|
|
type IconsDataRef = Ref<IconsData>
|
|
|
|
const iconsData: IconsDataRef = ref(icons)
|
|
|
|
export const useIconsData = (): IconsDataRef => iconsData
|
|
|
|
if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) {
|
|
__VUE_HMR_RUNTIME__.updateIcons = (data: IconsData) => {
|
|
iconsData.value = data
|
|
}
|
|
}
|