ananzhusen 1 жил өмнө
parent
commit
3cc7b9f90c

+ 6 - 0
src/views/components/FileProps.vue

@@ -252,6 +252,7 @@ import ElementTree from './ElementTree.vue';
 import CodeEditor from '@/views/components/common/CodeEditor.vue';
 import { autoSave, inTreePanel, useAssets } from '@/services/common';
 import { MessagePlugin } from 'tdesign-vue-next';
+import { loadCss } from '@meta2d/core';
 
 const headers = {
   Authorization: 'Bearer ' + (localStorage.token || getCookie('token') || ''),
@@ -415,6 +416,11 @@ const addIconUrl = () => {
   data.meta2dData.iconUrls.push(data.iconUrl);
   // @ts-ignore
   meta2d.store.data.iconUrls = data.meta2dData.iconUrls;
+  if (meta2d.store.data.iconUrls) {
+    for (const item of meta2d.store.data.iconUrls) {
+      loadCss(item);
+    }
+  }
   data.iconUrl = '';
   autoSave(true);
 };

+ 7 - 2
src/views/components/common/Iconfonts.vue

@@ -1,7 +1,12 @@
 <template>
   <ul class="icons">
-    <li v-for="item in icons" :key="item.icon" class="icon">
-      <i :class="item.iconFamily" @click="onSelected(item)">
+    <li
+      v-for="item in icons"
+      :key="item.icon"
+      class="icon"
+      @click="onSelected(item)"
+    >
+      <i :class="item.iconFamily">
         {{ item.icon }}
       </i>
     </li>