mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
Merge pull request #52 from FungYuu/docs-free
docs: Modify the FixedLayoutProps in a free layout
This commit is contained in:
commit
6c13bffbf3
@ -40,7 +40,7 @@ Canvas configuration is declarative, providing data, rendering, event, and plugi
|
|||||||
|
|
||||||
```tsx pure title="use-editor-props.tsx"
|
```tsx pure title="use-editor-props.tsx"
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { type FixedLayoutProps } from '@flowgram.ai/free-layout-editor';
|
import { type FreeLayoutProps } from '@flowgram.ai/free-layout-editor';
|
||||||
import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
|
import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
|
||||||
|
|
||||||
import { intialData } from './initial-data' // 初始化数据
|
import { intialData } from './initial-data' // 初始化数据
|
||||||
@ -48,8 +48,8 @@ import { nodeRegistries } from './node-registries' // 节点声明配置
|
|||||||
import { BaseNode } from './base-node' // 节点渲染
|
import { BaseNode } from './base-node' // 节点渲染
|
||||||
|
|
||||||
export function useEditorProps(
|
export function useEditorProps(
|
||||||
): FixedLayoutProps {
|
): FreeLayoutProps {
|
||||||
return useMemo<FixedLayoutProps>(
|
return useMemo<FreeLayoutProps>(
|
||||||
() => ({
|
() => ({
|
||||||
/**
|
/**
|
||||||
* Initialize data
|
* Initialize data
|
||||||
|
|||||||
@ -42,7 +42,7 @@ function App() {
|
|||||||
|
|
||||||
```tsx pure title="use-editor-props.tsx"
|
```tsx pure title="use-editor-props.tsx"
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { type FixedLayoutProps } from '@flowgram.ai/free-layout-editor';
|
import { type FreeLayoutProps } from '@flowgram.ai/free-layout-editor';
|
||||||
import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
|
import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
|
||||||
|
|
||||||
import { intialData } from './initial-data' // 初始化数据
|
import { intialData } from './initial-data' // 初始化数据
|
||||||
@ -50,8 +50,8 @@ import { nodeRegistries } from './node-registries' // 节点声明配置
|
|||||||
import { BaseNode } from './base-node' // 节点渲染
|
import { BaseNode } from './base-node' // 节点渲染
|
||||||
|
|
||||||
export function useEditorProps(
|
export function useEditorProps(
|
||||||
): FixedLayoutProps {
|
): FreeLayoutProps {
|
||||||
return useMemo<FixedLayoutProps>(
|
return useMemo<FreeLayoutProps>(
|
||||||
() => ({
|
() => ({
|
||||||
/**
|
/**
|
||||||
* 初始化数据
|
* 初始化数据
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user