Every interesting innovation comes from a life of helplessness and pain.

In my recent job, I came across a need to do permission management filtering.

Briefly summarize requirements:

1 Show the organizational structure of an organization

2 Click any node in the organizational structure to query the organizational structure

If you don’t want to be painfully repetitive, build a wheel

It was the first time I encountered such a requirement, and I spent a lot of time to solve it. In the process of solving it, I had an inspiration that I could combine recursion of functions to solve this requirement with less code.

So after some research, wrote their first plug-in, here we also share exchanges, welcome everyone to use exchanges ~

Here’s how it works in demo



If you think this wheel is funny, give it a star

Github project address

The following code will implement some functions similar to Ztree.js