Skip to content

[Feature request] Add CSS class (or style) to tree-node div #148

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

Closed
tafel opened this issue Feb 12, 2025 · 2 comments
Closed

[Feature request] Add CSS class (or style) to tree-node div #148

tafel opened this issue Feb 12, 2025 · 2 comments

Comments

@tafel
Copy link

tafel commented Feb 12, 2025

Hi,

It should be useful for my use case to put a css class or/and css styles directly to the <div class="tree-node"> element.

Should it be possible to add a prop to the Draggable component, something like:

<Draggable
  :items="items"
  text-key="text"
  style-key="style"
  css-key="css"
/>
const items = [
  {
    text: 'test 1',
    style: { backgroundColor: 'red' },
    css: 'some-class-1'
  },
  {
    text: 'test 2',
    style: { backgroundColor: 'green' },
    css: 'some-class-2'
  }
]

Thanks

@phphe
Copy link
Owner

phphe commented Feb 12, 2025

https://hetree.phphe.com/v2/api#stat, you need use https://hetree.phphe.com/v2/api#stathandler, to set stat.style from your node data

@tafel
Copy link
Author

tafel commented Feb 12, 2025

Working like a charm, thanks!

@phphe phphe closed this as completed Apr 15, 2025
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