Skip to content

Commit e8a6ce8

Browse files
authored
Merge pull request #2 from Create-Peace/feature_refactor_build_method
Feature refactor build method
2 parents df6ef44 + 5a4b4c5 commit e8a6ce8

36 files changed

+30794
-15515
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
["@babel/preset-env"], ["@vue/babel-preset-jsx", {
4+
"injectH": false
5+
}]
6+
]
7+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
/lib

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ node_modules
66
# local env files
77
.env.local
88
.env.*.local
9+
.history
910

1011
# Log files
1112
npm-debug.log*

README.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
1-
# 基于Vue实现的Tree组件支持拖拽
1+
## Tree component based on Vue implementation
22

3-
### 支持搜索,checkbox勾选,大数据量时的虚拟滚动
3+
## Simple usage
4+
```bash
5+
npm install VueTree
6+
```
47

5-
### 更详细的API 正在整理中
68

9+
## Advantages
10+
* Simple and very easy to use.
11+
12+
* Big data list with high render performance and efficient.
13+
14+
15+
## Api
16+
17+
### props
18+
19+
20+
Property | Type | Description | Default
21+
--- | --- | ---- | ----
22+
treeData |Array[Object] | <div style="width:200pt">The treeNodes data Array,if set it then you need not to construct children TreeNode.(key should be unique across the whole array)</div> | -
23+
showCheckbox | boolean | Add a Checkbox before the treeNodes | false
24+
draggable | boolean | Whether to allow dropping on the node | false
25+
checkStrictly | boolean | <div style="width: 200pt">Check treeNode precisely; parent treeNode and children treeNodes are not associated</div> | false
26+
lazy | boolean | Lazy load node data | false
27+
load | function |Load data asynchronously | function(node)| -
28+
immediatelyLoad | boolean | First load data when lazy load | false
29+
virtual | boolean | Disable virtual scroll when set to false | false
30+
height | number | When virtual scroll must set | -
31+
expandedAll | boolean | Whether to expand all treeNodes by default | -
32+
keeps | number | <div style="width: 200pt">How many items you are expecting the virtual list to keep rendering in the real dom.</div> | 30
33+
searchVal | String | Search keywords | -
34+
35+
36+
## Events
37+
Property | Type | Description | Params
38+
-- | -- | -- | --
39+
on-selected-change |function | <div style="width: 150pt">Callback function for when the user right clicks a treeNode</div> | function(node)
40+
on-drop | function | Callback function for when the user drag node | function({ parentNode, targetNode, callback })
41+
on-checked-item | function | Callback function for when the user check node | function({ node, vNode })
42+
on-checked-change | function | Callback function for when checkbox change |function({ node, selectedData })
43+
44+
45+
## Contributions
46+
47+
Welcome to improve this component with any issue, pull request or code review.

examples/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
../lib
2+
../node_modules

examples/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

examples/package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "docs-example",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "npm run serve",
7+
"serve": "vue-cli-service serve",
8+
"build": "vue-cli-service build",
9+
"lint": "vue-cli-service lint"
10+
},
11+
"dependencies": {
12+
"core-js": "^3.6.4",
13+
"vue-github-button": "^1.1.2",
14+
"vue-router": "^3.1.6"
15+
},
16+
"devDependencies": {
17+
"@vue/cli-plugin-babel": "~4.3.0",
18+
"@vue/cli-plugin-eslint": "~4.3.0",
19+
"@vue/cli-plugin-router": "^4.3.0",
20+
"@vue/cli-service": "~4.3.0",
21+
"babel-eslint": "^10.1.0",
22+
"eslint": "^6.7.2",
23+
"eslint-plugin-vue": "^6.2.2",
24+
"less": "^3.11.1",
25+
"less-loader": "^5.0.0",
26+
"raw-loader": "^4.0.0",
27+
"vue-template-compiler": "^2.6.11"
28+
},
29+
"eslintConfig": {
30+
"root": true,
31+
"env": {
32+
"node": true
33+
},
34+
"extends": [
35+
"plugin:vue/essential",
36+
"eslint:recommended"
37+
],
38+
"parserOptions": {
39+
"parser": "babel-eslint"
40+
},
41+
"rules": {}
42+
},
43+
"browserslist": [
44+
"> 1%",
45+
"last 2 versions",
46+
"not dead"
47+
]
48+
}
File renamed without changes.

public/index.html renamed to examples/public/index.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
88
<title><%= htmlWebpackPlugin.options.title %></title>
9-
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
10-
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet">
11-
<% } %>
12-
13-
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
14-
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
15-
<% } %>
9+
<link rel="stylesheet" href="<%= BASE_URL %>milligram.css" />
10+
<link rel="stylesheet" href="<%= BASE_URL %>highlight/theme.css" />
11+
<script src="<%= BASE_URL %>highlight/pack.js"></script>
12+
<style>
13+
.ml20 {
14+
margin-left: 20px;
15+
}
16+
</style>
1617
</head>
1718
<body>
1819
<noscript>

0 commit comments

Comments
 (0)