Skip to content

Commit

Permalink
feat: pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fengxiaotx committed Dec 9, 2023
1 parent c474ab2 commit aee071f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion formily/setters/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"baseUrl": "./",
"allowSyntheticDefaultImports": true,
"paths": {
"@trionesdev/*": ["../../packages/*"]
"@trionesdev/*": ["../../packages/*", "../../formily/*"]
}
}
}
8 changes: 6 additions & 2 deletions packages/core/src/models/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ export class Operation {
}

dispatch(event: ICustomEvent, callback?: () => void) {
if (this.workspace.dispatch(event) === false) return
if (isFn(callback)) return callback()
if (this.workspace.dispatch(event) === false) {
return
}
if (isFn(callback)) {
return callback()
}
}

snapshot(type?: string) {
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/models/TreeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ const resolveDesignerProps = (
node: TreeNode,
props: IDesignerControllerProps
) => {
if (isFn(props)) return props(node)
if (isFn(props)) {
// @ts-ignore
return props(node)
}
return props
}

Expand Down Expand Up @@ -338,6 +341,7 @@ export class TreeNode {

triggerMutation<T>(event: any, callback?: () => T, defaults?: T): T {
if (this.operation) {
// @ts-ignore
const result = this.operation.dispatch(event, callback) || defaults
this.takeSnapshot(event?.type)
return result
Expand Down

0 comments on commit aee071f

Please sign in to comment.