PHPackages                             tu6ge/element-tree - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tu6ge/element-tree

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

tu6ge/element-tree
==================

0.3.1(5y ago)23MITPHP

Since Aug 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tu6ge/element-tree)[ Packagist](https://packagist.org/packages/tu6ge/element-tree)[ RSS](/packages/tu6ge-element-tree/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (5)Used By (0)

element-tree
============

[](#element-tree)

该composer 包是用来方便element-ui读取文件目录的

> 最近公司做项目，需要读取目录下的文件和文件夹，感觉element的tree组件挺漂亮的，就采用了这个做前端输出，但是在后端构造数据结构的时候遇到了一些波折，不过最终还是解决了，为了方便他人，我把后端的实现方式开源了，希望能帮助到别人

Install
-------

[](#install)

```
composer require tu6ge/element-tree

```

关于版本号
-----

[](#关于版本号)

采用 [语义化版本](https://semver.org/lang/zh-CN/) 2.0.0

Usage
-----

[](#usage)

php代码：

```
include_once "vendor/autoload.php";

$tree = new \ElementTree\Tree();
$rs = $tree->get(__DIR__);

$json = json_encode($rs);
```

vue code：

```

import {Tree} from "element-ui"
export default {
  name: 'HelloWorld',
  data () {
    return {
        msg: 'Welcome to Your Vue.js App',
        list: [...],// 这里加上php返回的数据
        defaultProps: {
          children: 'children',
          label: 'label'
        }
    }
  },
  methods:{
      handleNodeClick(data) {
        console.log(data);
      }
  },
  components:{
      [Tree.name]:Tree
  }
}

```

Preview
-------

[](#preview)

[![img](img/preview.png)](img/preview.png)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~131 days

Total

4

Last Release

2109d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96c9b3b5c4300583d0c78a813861abf9ad3d97a26607464f481054a58fbe4b7e?d=identicon)[tu6ge](/maintainers/tu6ge)

---

Top Contributors

[![tu6ge](https://avatars.githubusercontent.com/u/4115242?v=4)](https://github.com/tu6ge "tu6ge (22 commits)")

### Embed Badge

![Health badge](/badges/tu6ge-element-tree/health.svg)

```
[![Health](https://phpackages.com/badges/tu6ge-element-tree/health.svg)](https://phpackages.com/packages/tu6ge-element-tree)
```

###  Alternatives

[mauricius/laravel-htmx

Laravel helper library for Htmx

363112.7k1](/packages/mauricius-laravel-htmx)[bodunde/geocoder

A laravel package that helps you with geocoding addresses and reverse geocoding coordinates using the google maps api. It also helps in calculating the distance between two locations using the Hervasine formula and the coordinates of the locations

247.7k](/packages/bodunde-geocoder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
