Skip to content

Commit

Permalink
fix(react): fix conflict of registerDesignerBehaviors
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Oct 15, 2021
1 parent 6c6d1fb commit a88611a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ const DESIGNER_GlobalRegistry = {
packages.forEach((sources) => {
reSortBehaviors(results, sources)
})
DESIGNER_BEHAVIORS_STORE.value = results
if (results.length) {
DESIGNER_BEHAVIORS_STORE.value = results
}
},
}

Expand Down
3 changes: 3 additions & 0 deletions packages/playground/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import 'antd/dist/antd.less'
import './theme.less'

const RootBehavior = createBehavior({
name: 'Root',
selector: 'Root',
designerProps: {
droppable: true,
Expand All @@ -48,6 +49,7 @@ const RootBehavior = createBehavior({
})

const InputBehavior = createBehavior({
name: 'Input',
selector: (node) =>
node.componentName === 'Field' && node.props['x-component'] === 'Input',
designerProps: {
Expand Down Expand Up @@ -184,6 +186,7 @@ const InputBehavior = createBehavior({
})

const CardBehavior = createBehavior({
name: 'Card',
selector: 'Card',
designerProps: {
droppable: true,
Expand Down

0 comments on commit a88611a

Please sign in to comment.