├── .gitignore
├── .pnpmfile.cjs
├── .prettierignore
├── .vscode
└── tasks.json
├── README.md
├── examples
├── example-vue2-no-ts
│ ├── .gitignore
│ ├── index.html
│ ├── package.json
│ └── src
│ │ ├── App.vue
│ │ └── main.js
├── example-vue2
│ ├── .browserslistrc
│ ├── .gitignore
│ ├── README.md
│ ├── babel.config.js
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ └── index.html
│ ├── src
│ │ ├── App.vue
│ │ ├── components
│ │ │ └── HelloWorld.vue
│ │ ├── data.json
│ │ ├── main.ts
│ │ ├── shims-tsx.d.ts
│ │ └── shims-vue.d.ts
│ ├── tsconfig.json
│ └── vue.config.js
├── example-vue3
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── App.vue
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── components
│ │ │ └── HelloWorld.vue
│ │ ├── data.json
│ │ ├── env.d.ts
│ │ └── main.ts
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
└── iife
│ ├── package.json
│ ├── vue2.html
│ └── vue3.html
├── lerna.json
├── package.json
├── packages
├── dnd-utils
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.MD
│ ├── index.html
│ ├── package.json
│ ├── rogo.config.ts
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── main.ts
│ │ └── vite-env.d.ts
│ └── tsconfig.json
├── docs-site
│ ├── .eslintrc
│ ├── .gitignore
│ ├── .prettierrc
│ ├── .stylelintrc
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── docs
│ │ ├── config.ts
│ │ ├── en
│ │ │ ├── hire-me.md
│ │ │ ├── index.md
│ │ │ ├── pro.md
│ │ │ ├── quick-support.md
│ │ │ ├── v1
│ │ │ │ ├── api.md
│ │ │ │ ├── guide.md
│ │ │ │ └── index.md
│ │ │ └── v2
│ │ │ │ ├── api.md
│ │ │ │ └── guide.md
│ │ ├── style.scss
│ │ └── zh
│ │ │ ├── hire-me.md
│ │ │ ├── index.md
│ │ │ ├── pro.md
│ │ │ ├── quick-support.md
│ │ │ ├── v1
│ │ │ ├── api.md
│ │ │ ├── guide.md
│ │ │ └── index.md
│ │ │ └── v2
│ │ │ ├── api.md
│ │ │ └── guide.md
│ ├── index.html
│ ├── package.json
│ ├── postcss.config.js
│ ├── prerender.config.ts
│ ├── public
│ │ ├── sponsors
│ │ │ └── edoobox.svg
│ │ └── videos
│ │ │ ├── he-tree-cross-tree-drag.mp4
│ │ │ ├── he-tree-drag-copy.mp4
│ │ │ └── he-tree-drag-table.mp4
│ ├── scripts
│ │ ├── compile-docs.ts
│ │ ├── deploy.ts
│ │ ├── tpl
│ │ │ ├── CodeDemoWrapper.vue
│ │ │ ├── deploy.tpl.sh
│ │ │ └── doc-template.vue
│ │ └── utils.ts
│ ├── src
│ │ ├── @type
│ │ │ ├── shim-vue.d.ts
│ │ │ ├── shims-vue.d.ts
│ │ │ ├── source.d.ts
│ │ │ └── vue-extend.d.ts
│ │ ├── App.vue
│ │ ├── HTMLHead.tsx
│ │ ├── analytics.ts
│ │ ├── assets
│ │ │ ├── img
│ │ │ │ └── coffee.jpg
│ │ │ └── style
│ │ │ │ ├── site.scss
│ │ │ │ ├── tailwind.css
│ │ │ │ └── transitions
│ │ │ │ └── fade.scss
│ │ ├── components
│ │ │ ├── Anchor.vue
│ │ │ ├── AspectBox.vue
│ │ │ ├── BackToTop.vue
│ │ │ ├── Badge.vue
│ │ │ ├── Broadcast.ts
│ │ │ ├── Caret.vue
│ │ │ ├── CodeContainer.vue
│ │ │ ├── I18n.vue
│ │ │ ├── Icon.vue
│ │ │ ├── PageProgressBar.vue
│ │ │ ├── VA.vue
│ │ │ ├── VClose.vue
│ │ │ ├── VIconMDI.vue
│ │ │ ├── VInput.vue
│ │ │ ├── VModal.vue
│ │ │ ├── VModals.vue
│ │ │ └── globalComponents.ts
│ │ ├── config.ts
│ │ ├── current.ts
│ │ ├── directives.ts
│ │ ├── docsSubmenu.ts
│ │ ├── http.ts
│ │ ├── i18n.ts
│ │ ├── layouts
│ │ │ └── default_layout.vue
│ │ ├── main.ts
│ │ ├── parts
│ │ │ ├── DocTemplateBase.vue
│ │ │ ├── DocsMenuItem.vue
│ │ │ ├── SearchModal.vue
│ │ │ └── vheading.vue
│ │ ├── plugins
│ │ │ ├── floating-vue.ts
│ │ │ ├── fuzzySearch.ts
│ │ │ ├── searchData.ts
│ │ │ ├── useWindowSize.ts
│ │ │ └── vue-router-scroll-container.tsx
│ │ ├── router.ts
│ │ ├── scroll-to-hash.ts
│ │ ├── store.ts
│ │ ├── utils.ts
│ │ └── views
│ │ │ └── NotFound.vue
│ ├── tailwind.config.js
│ ├── tsconfig.json
│ └── vite.config.js
├── he-tree-vue
│ ├── .npmignore
│ ├── .vscode
│ │ └── extensions.json
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── index.html
│ ├── package.json
│ ├── src
│ │ ├── .gitignore
│ │ ├── App.vue
│ │ ├── assets
│ │ │ └── material-design.css
│ │ ├── components
│ │ │ ├── BaseTree.vue
│ │ │ ├── DraggableTree.ts
│ │ │ ├── OpenIcon.vue
│ │ │ ├── TreeNode.vue
│ │ │ └── TreeProcessorVue.ts
│ │ ├── examples
│ │ │ ├── Base.vue
│ │ │ ├── CrossDrag.vue
│ │ │ ├── Draggable.vue
│ │ │ ├── MaterialDesign.vue
│ │ │ ├── Other1.vue
│ │ │ ├── Other2.vue
│ │ │ ├── Other3.vue
│ │ │ ├── Refresh.vue
│ │ │ ├── TableTree.vue
│ │ │ ├── Virtualization.vue
│ │ │ ├── WithOpenAndCheckBox.vue
│ │ │ ├── data.json
│ │ │ ├── data.yaml
│ │ │ └── table.json
│ │ ├── index.ts
│ │ ├── main.js
│ │ └── shims-vue.d.ts
│ ├── style
│ │ ├── default.css
│ │ └── material-design.css
│ ├── sub-vue2
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── App.vue
│ │ │ └── main.js
│ │ ├── tsconfig.json
│ │ ├── vite.config.js
│ │ └── vite.dev.js
│ ├── switch-virtual-list.js
│ ├── tsconfig.json
│ ├── vite.config.js
│ ├── vite.dev.js
│ └── vue2
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ └── index.mjs
└── tree-utils
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.MD
│ ├── index.html
│ ├── package.json
│ ├── rogo.config.ts
│ ├── src
│ └── index.ts
│ └── tsconfig.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
└── sponsors
└── edoobox.svg
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist/
3 |
4 | # yarn
5 | .yarn/*
6 | !.yarn/patches
7 | !.yarn/releases
8 | !.yarn/plugins
9 | !.yarn/sdks
10 | !.yarn/versions
11 | .pnp.*
12 |
13 | # log
14 | *.log
15 |
16 | # edtior
17 | .vscode/*
18 | !.vscode/tasks.json
--------------------------------------------------------------------------------
/.pnpmfile.cjs:
--------------------------------------------------------------------------------
1 | function readPackage(pkg, context) {
2 | // Override the manifest of foo@1.x after downloading it from the registry
3 | if (pkg.name === "vue-template-compiler") {
4 | pkg.dependencies = {
5 | ...pkg.dependencies,
6 | vue: pkg.version,
7 | };
8 | console.log("Force set dependence vue for vue-template-compiler.\n");
9 | }
10 |
11 | return pkg;
12 | }
13 |
14 | module.exports = {
15 | hooks: {
16 | readPackage,
17 | },
18 | };
19 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "npm",
6 | "script": "dev",
7 | "path": "packages/docs-site",
8 | "group": "build",
9 | "problemMatcher": [],
10 | "label": "npm: dev - packages/docs-site"
11 | },
12 | {
13 | "type": "npm",
14 | "script": "watch-compile-docs",
15 | "path": "packages/docs-site",
16 | "group": "build",
17 | "problemMatcher": [],
18 | "label": "npm: watch-compile-docs - packages/docs-site"
19 | },
20 | {
21 | "label": "Document Dev",
22 | "dependsOn": ["npm: watch-compile-docs - packages/docs-site", "npm: dev - packages/docs-site"]
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # he-tree
2 |
3 | 
4 | 
5 | 
6 | 
7 |
8 | Vue tree component. [React click here](https://github.com/phphe/he-tree-react). Features: Vue2, Vue3, TypeScript, SSR, nested, virtual list, draggable, sortable, placeholder for drag, table tree, based on Drag and Drop API, deal with any other code based on Drag and Drop API.
9 |
10 | Vue 树组件. [React 点这](https://github.com/phphe/he-tree-react). 特点: 支持 Vue2, Vue3, TypeScript, SSR, 嵌套, 虚拟列表, 可拖拽, 拖拽排序, 拖拽时使用占位节点表示可放置位置, 表格模式, 基于 Drag and Drop API, 可与其他基于 Drag and Drop API 的代码交互.
11 |
12 | [Docs & Demo](https://hetree.phphe.com) | [文档和示例](https://hetree.phphe.com/zh)
13 |
14 | [React Tree](https://github.com/phphe/he-tree-react) | [React 版树组件](https://github.com/phphe/he-tree-react) 👑👑👑
15 |
16 | ## Sponsors
17 |
18 |
19 | Silver Sponsors
20 |
21 | 
22 | edoobox
23 |
24 |
25 |
26 | Sponsors' logos and links will be displayed here and in the documentation. [Become a Sponsor](https://www.patreon.com/phphe).
27 |
28 | ## License
29 |
30 | [MIT](http://opensource.org/licenses/MIT)
31 |
--------------------------------------------------------------------------------
/examples/example-vue2-no-ts/.gitignore:
--------------------------------------------------------------------------------
1 | package-lock.json
2 | # Logs
3 | logs
4 | *.log
5 | npm-debug.log*
6 | yarn-debug.log*
7 | yarn-error.log*
8 | pnpm-debug.log*
9 | lerna-debug.log*
10 |
11 | node_modules
12 | .DS_Store
13 | dist
14 | dist-ssr
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/examples/example-vue2-no-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/example-vue2-no-ts/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "he-tree-example-vue2-no-ts",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "vue": "~2.6.11",
11 | "@he-tree/vue": "^2.7.8",
12 | "@vue/composition-api": "^1.4.6"
13 | },
14 | "devDependencies": {
15 | "@vue/cli-plugin-babel": "~5.0.0",
16 | "@vue/cli-service": "~5.0.0",
17 | "typescript": "~4.5.5",
18 | "vue-template-compiler": "~2.6.14"
19 | },
20 | "browserslist": [
21 | "> 1%",
22 | "last 2 versions",
23 | "not ie <= 8"
24 | ]
25 | }
--------------------------------------------------------------------------------
/examples/example-vue2-no-ts/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
61 |
62 |
63 |
118 |
--------------------------------------------------------------------------------
/examples/example-vue2-no-ts/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 |
5 | new Vue({
6 | render: (h) => h(App)
7 | }).$mount('#app')
8 |
--------------------------------------------------------------------------------
/examples/example-vue2/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/examples/example-vue2/.gitignore:
--------------------------------------------------------------------------------
1 | package-lock.json
2 |
3 | .DS_Store
4 | node_modules
5 | /dist
6 |
7 |
8 | # local env files
9 | .env.local
10 | .env.*.local
11 |
12 | # Log files
13 | npm-debug.log*
14 | yarn-debug.log*
15 | yarn-error.log*
16 | pnpm-debug.log*
17 |
18 | # Editor directories and files
19 | .idea
20 | .vscode
21 | *.suo
22 | *.ntvs*
23 | *.njsproj
24 | *.sln
25 | *.sw?
26 |
--------------------------------------------------------------------------------
/examples/example-vue2/README.md:
--------------------------------------------------------------------------------
1 | # example-vue2
2 |
3 | Created with vue-cli.
4 |
5 | ## This example is ignored by pnpm. Run `npm install` to install dependencies.
6 |
7 | ## Project setup
8 |
9 | ```
10 | npm install
11 | ```
12 |
13 | ### Compiles and hot-reloads for development
14 |
15 | ```
16 | npm run serve
17 | ```
18 |
19 | ### Compiles and minifies for production
20 |
21 | ```
22 | npm run build
23 | ```
24 |
25 | ### Customize configuration
26 |
27 | See [Configuration Reference](https://cli.vuejs.org/config/).
28 |
--------------------------------------------------------------------------------
/examples/example-vue2/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/examples/example-vue2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-vue2",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "@he-tree/vue": "^2.7.8",
11 | "@vue/composition-api": "^1.4.6",
12 | "core-js": "^3.8.3",
13 | "vue": "~2.6.14",
14 | "vue-class-component": "^7.2.3",
15 | "vue-property-decorator": "^9.1.2"
16 | },
17 | "devDependencies": {
18 | "@vue/cli-plugin-babel": "~5.0.0",
19 | "@vue/cli-plugin-typescript": "~5.0.0",
20 | "@vue/cli-service": "~5.0.0",
21 | "typescript": "~4.5.5",
22 | "vue-template-compiler": "~2.6.14"
23 | }
24 | }
--------------------------------------------------------------------------------
/examples/example-vue2/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/phphe/he-tree/ab53bb210ee669eb09cfc4582cdf283673efd357/examples/example-vue2/public/favicon.ico
--------------------------------------------------------------------------------
/examples/example-vue2/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/example-vue2/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ stat.open ? "-" : "+" }}
7 |
8 |
10 | {{ node.text }}
11 |
12 |
13 |
14 |
15 |
16 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/examples/example-vue2/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
8 |
9 |
Installed CLI Plugins
10 |
14 |
Essential Links
15 |
22 |
Ecosystem
23 |
30 |
31 |
32 |
33 |
41 |
42 |
43 |
59 |
--------------------------------------------------------------------------------
/examples/example-vue2/src/data.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "text": "Projects",
4 | "children": [
5 | {
6 | "text": "Frontend",
7 | "children": [
8 | {
9 | "text": "Vue",
10 | "children": [
11 | {
12 | "text": "Nuxt"
13 | }
14 | ]
15 | },
16 | {
17 | "text": "React",
18 | "children": [
19 | {
20 | "text": "Next"
21 | }
22 | ]
23 | },
24 | {
25 | "text": "Angular"
26 | }
27 | ]
28 | },
29 | {
30 | "text": "Backend"
31 | }
32 | ]
33 | },
34 | {
35 | "text": "Videos",
36 | "children": [
37 | {
38 | "text": "Movie",
39 | "children": [
40 | {
41 | "text": "The Godfather"
42 | },
43 | {
44 | "text": "La Dolce Vita"
45 | },
46 | {
47 | "text": "In the Mood for Love"
48 | }
49 | ]
50 | },
51 | {
52 | "text": "AD"
53 | },
54 | {
55 | "text": "Shorts"
56 | }
57 | ]
58 | },
59 | {
60 | "text": "Photos",
61 | "children": [
62 | {
63 | "text": "Animals"
64 | },
65 | {
66 | "text": "Buildings"
67 | },
68 | {
69 | "text": "Sky"
70 | },
71 | {
72 | "text": "Sea"
73 | }
74 | ]
75 | },
76 | {
77 | "text": "Music",
78 | "children": [
79 | {
80 | "text": "My Happy Melodies."
81 | },
82 | {
83 | "text": "Hello Summer."
84 | },
85 | {
86 | "text": "An Overture To Happiness."
87 | },
88 | {
89 | "text": "Sunny Days."
90 | },
91 | {
92 | "text": "Every One Need Adventure."
93 | },
94 | {
95 | "text": "Happy, Chill Radio."
96 | },
97 | {
98 | "text": "I Found My Way."
99 | },
100 | {
101 | "text": "Early, Early Morning."
102 | }
103 | ]
104 | },
105 | {
106 | "text": "Games",
107 | "children": [
108 | {
109 | "text": "swimming"
110 | },
111 | {
112 | "text": "cycling"
113 | },
114 | {
115 | "text": "tennis"
116 | },
117 | {
118 | "text": "boxing"
119 | }
120 | ]
121 | },
122 | {
123 | "text": "Download"
124 | }
125 | ]
--------------------------------------------------------------------------------
/examples/example-vue2/src/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 |
4 | Vue.config.productionTip = false
5 |
6 | new Vue({
7 | render: h => h(App),
8 | }).$mount('#app')
9 |
--------------------------------------------------------------------------------
/examples/example-vue2/src/shims-tsx.d.ts:
--------------------------------------------------------------------------------
1 | import Vue, { VNode } from 'vue'
2 |
3 | declare global {
4 | namespace JSX {
5 | interface Element extends VNode {}
6 | interface ElementClass extends Vue {}
7 | interface IntrinsicElements {
8 | [elem: string]: any
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/example-vue2/src/shims-vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import Vue from 'vue'
3 | export default Vue
4 | }
5 |
--------------------------------------------------------------------------------
/examples/example-vue2/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "strict": true,
6 | "jsx": "preserve",
7 | "moduleResolution": "node",
8 | "resolveJsonModule": true,
9 | "experimentalDecorators": true,
10 | "skipLibCheck": true,
11 | "esModuleInterop": true,
12 | "allowSyntheticDefaultImports": true,
13 | "forceConsistentCasingInFileNames": true,
14 | "useDefineForClassFields": true,
15 | "sourceMap": true,
16 | "baseUrl": ".",
17 | "types": ["webpack-env"],
18 | "paths": {
19 | "@/*": ["src/*"]
20 | },
21 | "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
22 | },
23 | "include": [
24 | "src/**/*.ts",
25 | "src/**/*.tsx",
26 | "src/**/*.vue",
27 | "tests/**/*.ts",
28 | "tests/**/*.tsx"
29 | ],
30 | "exclude": ["node_modules"]
31 | }
32 |
--------------------------------------------------------------------------------
/examples/example-vue2/vue.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@vue/cli-service')
2 | module.exports = defineConfig({
3 | transpileDependencies: true
4 | })
5 |
--------------------------------------------------------------------------------
/examples/example-vue3/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/examples/example-vue3/README.md:
--------------------------------------------------------------------------------
1 | # Vue 3 + Typescript + Vite
2 |
3 | ## This example is ignored by pnpm. Run `npm install` to install dependencies.
4 |
5 | This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `
12 |