Skip to content

Commit 36e2c9a

Browse files
committed
refactor(extension): 优化 snapshot 交互体验,内容居中且开启拖拽画布,调整菜单顺序
1 parent d258242 commit 36e2c9a

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

examples/feature-examples/.umirc.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,6 @@ export default defineConfig({
5454
},
5555
],
5656
},
57-
{
58-
path: '/react',
59-
name: 'react node registry',
60-
routes: [
61-
{
62-
path: 'react',
63-
redirect: 'react/custom',
64-
},
65-
{
66-
path: '/react/custom',
67-
name: '自定义 React 节点',
68-
component: './react',
69-
},
70-
{
71-
path: '/react/portal',
72-
name: 'React Portal节点',
73-
component: './react/Portal',
74-
},
75-
],
76-
},
7757
{
7858
path: '/custom-edges',
7959
name: 'custom edges',
@@ -94,6 +74,26 @@ export default defineConfig({
9474
},
9575
],
9676
},
77+
{
78+
path: '/react',
79+
name: 'react node registry',
80+
routes: [
81+
{
82+
path: 'react',
83+
redirect: 'react/custom',
84+
},
85+
{
86+
path: '/react/custom',
87+
name: '自定义 React 节点',
88+
component: './react',
89+
},
90+
{
91+
path: '/react/portal',
92+
name: 'React Portal节点',
93+
component: './react/Portal',
94+
},
95+
],
96+
},
9797
{
9898
name: 'official extensions',
9999
path: '/extension',

examples/feature-examples/src/pages/extensions/snapshot/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ export default function SnapshotExample() {
135135
grid: {
136136
size: 20,
137137
},
138-
plugins: [Snapshot as any],
138+
stopMoveGraph: false,
139+
plugins: [Snapshot],
139140
})
140141
lf.register(ImageNode)
141142

@@ -146,6 +147,7 @@ export default function SnapshotExample() {
146147
},
147148
)
148149
lf.render(data)
150+
lf.fitView()
149151
lfRef.current = lf
150152
}
151153
}, [])

0 commit comments

Comments
 (0)