多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
965 B

import { defineNuxtPlugin } from '#imports'
export default defineNuxtPlugin(() => {
// Listen when 'Material Symbols' font is loaded
// and remove 'nc-fonts-not-loaded' class from <html> element
try {
document.documentElement?.classList.add('nc-fonts-not-loaded')
const fontFaces = [...document.fonts.values()]
const materialFont = fontFaces.find((fontFace) => fontFace.family === 'Material Symbols')
if (!materialFont || !materialFont?.loaded) {
document.documentElement?.classList.remove('nc-fonts-not-loaded')
return
}
materialFont?.loaded
.then(function () {
document.documentElement?.classList.remove('nc-fonts-not-loaded')
})
.catch(function (error) {
document.documentElement?.classList.remove('nc-fonts-not-loaded')
console.error(error)
})
} catch (error) {
document.documentElement?.classList.remove('nc-fonts-not-loaded')
console.error(error)
}
})