Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2] How to give extra props to component used in custom NodeInterface #407

Closed
neko-para opened this issue Apr 8, 2024 · 2 comments
Closed

Comments

@neko-para
Copy link

import { NodeInterface } from 'baklavajs'
import { markRaw } from 'vue'

import ISelectComp from './ISelectComp.vue'

export class ISelectInterface<KeySet extends string> extends NodeInterface<KeySet> {
  constructor(name: string, def: KeySet, vals: KeySet[]) {
    super(name, def)
    this.setComponent(markRaw(ISelectComp))
    this.setPort(false)
  }
}

As shown above, I've set ISelectComp as the component. Beside modelValue, it requires some extra options (like the vals as the choices). But how can I pass these options? I've searched documents and issues but not found yet.

@neko-para
Copy link
Author

After inspect into the predefined interfaces, it seems that there is a prop intf with the type of the defined interface passed. Hope this information could be mentioned in the document.

@newcat
Copy link
Owner

newcat commented Apr 9, 2024

Is this what you are looking for? https://v2.baklava.tech/visual-editor/customization.html#custom-components

@newcat newcat closed this as completed May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants