Skip to content

Commit

Permalink
fix: 修复 pluginOptions 失效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
boyongjiong committed Jul 31, 2024
1 parent 0c39da4 commit 325fa5b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default function BasicNode() {
// container: document.querySelector('#graph') as HTMLElement,
plugins: [Label],
pluginsOptions: {
Label: {
label: {
isMultiple: true,
maxCount: 3,
labelWidth: 80,
Expand Down Expand Up @@ -200,7 +200,7 @@ export default function BasicNode() {
key="text"
type="primary"
onClick={() => {
const nextLabel = lfRef?.current?.extension?.Label as Label
const nextLabel = lfRef?.current?.extension?.label as Label
nextLabel.updateTextMode(TextMode.TEXT)
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function MiniMapExtension() {
// plugins: [Control, MiniMap],
plugins: [Control],
pluginsOptions: {
MiniMap: {
miniMap: {
...miniMapOptions,
showEdge,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/tools/label/LabelOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class LabelOverlay extends Component<IToolProps, ILabelOverlayState> {
} = this.props

const elements = [...graphModel.nodes, ...graphModel.edges]
const curExtension = extension['Label'] as LabelPlugin
const curExtension = extension['label'] as LabelPlugin

if (curExtension) {
const labels: h.JSX.Element[] = [] // 保存所有的 Label 元素
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/tools/label/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type ILabelOptions = {
}

export class Label implements Extension {
static pluginName = 'Label'
static pluginName = 'label'

lf: LogicFlow
options: ILabelOptions
Expand Down

0 comments on commit 325fa5b

Please sign in to comment.