Q-Tree with hyperlink
Is that possible that Q-Tree with hyperlink?
I want to design the layout like this, left part is a tree menu, when user click tree leaf node, the right part will show related content. The Q-Tree has the property “selected”, but still not strong.
I think you can change route when a tree leaf node is clicked and the right part is your router-view.
And I think with some css you can style the selected node
Yes, I agree with you. So I did it like this, when a tree leaf node is clicked, QTree “selected” property is filled, then it can navigate by router. If I click the same node again, as you know, the node is deselected and QTree “selected” property is empty now. But at this time, it cannot navigate, right? I want the tree can navigate everytime when I click the node, is that possible? Thanks a lot for you help！
There’s one thing not documented. You can use handler on a node. See it in jsfiddle: https://jsfiddle.net/s8pqkq8d/21/
@chbarr Thanks a lot! But considering the user experience, I think there is still something to be improved, as the demo in the link, when the cursor focus on the node, the cursor should change to “hand”. I tried to use tree property “selected.sync” and it becomes better, but as you know, when click the tree node secondly, the node is deselected.
Hopefully, it can be improved in the future.