Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-wow committed Jan 13, 2025
1 parent 6de0c1f commit 861a6fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/plugins/materials/src/composable/useMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ const parseMaterialsDependencies = (materialBundle) => {
const { scripts: scriptsDeps, styles: stylesDeps } = useResource().appSchemaState.materialsDeps

packages?.forEach((pkg) => {
if (!pkg.script || scriptsDeps.find((item) => item.package === pkg.package)) {
if (!pkg.script || !pkg.package || scriptsDeps.find((item) => item.package === pkg.package)) {
return
}

Expand Down
16 changes: 9 additions & 7 deletions packages/plugins/materials/src/composable/useResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@ const fetchResource = async ({ isInit = true } = {}) => {

// 获取工具类的依赖,用于预览加载。格式和物料依赖一致,便于处理
const getUtilsDeps = () => {
return appSchemaState.utils.map((item) => {
return {
...item,
package: item.content.package,
script: item.content.cdnLink
}
})
return appSchemaState.utils
.filter((item) => item.type === 'npm')
.map((item) => {
return {
...item,
package: item.content?.package,
script: item.content?.cdnLink
}
})
}

export default function () {
Expand Down

0 comments on commit 861a6fc

Please sign in to comment.