Skip to content

Commit

Permalink
fix: preview page breadcrumb don't exist useBlock method and preview …
Browse files Browse the repository at this point in the history
…block error when type undefined (#988)

* fix: preview breadcrumb don't exist useBlock method

* fix: resolve block preview error when type is undefined

---------

Co-authored-by: hexqi <[email protected]>
  • Loading branch information
chilingling and hexqi authored Jan 2, 2025
1 parent d30593a commit 3e63170
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/toolbars/breadcrumb/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
plugins.render = breadcrumbData.value[0] === CONSTANTS.PAGETEXT ? PLUGINS_ID.PAGEID : PLUGINS_ID.BLOCKID
}
const currentBlock = computed(useBlock().getCurrentBlock)
const currentBlock = computed(() => useBlock?.()?.getCurrentBlock?.())
const handleChangeSchema = (newSchema) => {
useBlock().initBlock({ ...useBlock().getCurrentBlock(), content: newSchema })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const defaultGenPropsHook = (schema) => {

properties.forEach(({ content = [] }) => {
content.forEach(({ property, type, defaultValue }) => {
let propType = capitalize(type)
let propType = type && capitalize(type)
let propValue = defaultValue

if (propType === 'String') {
Expand Down

0 comments on commit 3e63170

Please sign in to comment.