Skip to content

Commit

Permalink
fix: ssr throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined committed Nov 20, 2020
1 parent 531e8f4 commit 99d24ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/icons-vue/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ let cssInjectedFlag = false;
export const useInsertStyles = (styleStr: string = iconStyles) => {
nextTick(() => {
if (!cssInjectedFlag) {
insertCss(styleStr, {
prepend: true,
});
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
insertCss(styleStr, {
prepend: true,
});
}
cssInjectedFlag = true;
}
});
Expand Down

0 comments on commit 99d24ba

Please sign in to comment.