Skip to content

Commit

Permalink
refactor(useMaterials): review bot
Browse files Browse the repository at this point in the history
  • Loading branch information
wenmine committed Jul 1, 2024
1 parent 3b337d1 commit 3a3c210
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions packages/common/js/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ const open = (params = {}) => {
params.app = paramsMap.get('id')
params.tenant = paramsMap.get('tenant')
const { scripts, styles } = useMaterial().resState.thirdPartyDeps
params.scripts = scripts
params.scripts = {}
scripts
.filter((item) => item.script)
.reduce((pre, cur) => ({ ...pre, [cur.package]: cur.script }), {})
.forEach((item) => {
params.scripts[item.package] = item.script
})
params.styles = [...styles]

const href = window.location.href.split('?')[0] || './'
Expand Down
2 changes: 1 addition & 1 deletion packages/settings/props/src/composable/useProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const getProps = (schema, parent) => {
schema: metaSchema,
content,
properties
} = useMaterial().getMaterial(isPageOrBlock(schema) ? 'div' : componentName)
} = useMaterial().getMaterial(isPageOrBlock(schema) ? 'div' : componentName) || {}
const schemaProps = properties || metaSchema?.properties || content?.schema?.properties || []
const propGroups = [...schemaProps]

Expand Down

0 comments on commit 3a3c210

Please sign in to comment.