Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
vue-jstree
Advanced tools
A tree plugin for vue2
http://zdy1988.github.io/vue-jstree
npm install vue-jstree
import VJstree from 'vue-jstree'
new Vue({
components: {
VJstree
}
})
npm install
npm run dev
<v-jstree :data="data" show-checkbox multiple allow-batch whole-row @item-click="itemClick"></v-jstree>
new Vue({
data: {
data: [
{
"text": "Same but with checkboxes",
"children": [
{
"text": "initially selected",
"selected": true
},
{
"text": "custom icon",
"icon": "fa fa-warning icon-state-danger"
},
{
"text": "initially open",
"icon": "fa fa-folder icon-state-default",
"opened": true,
"children": [
{
"text": "Another node"
}
]
},
{
"text": "custom icon",
"icon": "fa fa-warning icon-state-warning"
},
{
"text": "disabled node",
"icon": "fa fa-check icon-state-success",
"disabled": true
}
]
},
{
"text": "Same but with checkboxes",
"opened": true,
"children": [
{
"text": "initially selected",
"selected": true
},
{
"text": "custom icon",
"icon": "fa fa-warning icon-state-danger"
},
{
"text": "initially open",
"icon": "fa fa-folder icon-state-default",
"opened": true,
"children": [
{
"text": "Another node"
}
]
},
{
"text": "custom icon",
"icon": "fa fa-warning icon-state-warning"
},
{
"text": "disabled node",
"icon": "fa fa-check icon-state-success",
"disabled": true
}
]
},
{
"text": "And wholerow selection"
}
]
},
methods: {
itemClick (node) {
console.log(node.model.text + ' clicked !')
}
}
})
Props | Type | Default | Describe |
---|---|---|---|
data | Array | set tree data | |
size | String | set tree item size , value : 'large' or '' or ''small' | |
show-checkbox | Boolean | false | |
whole-row | Boolean | false | |
no-dots | Boolean | false | |
collapse | Boolean | false | set all tree item collapse state |
multiple | Boolean | false | set multiple selected tree item |
allow-batch | Boolean | false | |
text-field-name | String | 'text' | set tree item display field |
value-field-name | String | 'value' | set tree item value field |
children-field-name | String | 'children' | set tree item children field |
item-events | Object | {} | register any event to tree item, example |
async | Function | async load callback function , if node is a leaf ,you can set 'isLeaf: true' in data | |
loading-text | String | 'Loading' | set loading text |
draggable | Boolean | false | set tree item can be dragged , selective drag and drop can set 'dragDisabled: true' and 'dropDisabled: true' , all default value is 'false' |
drag-over-background-color | String | '#C9FDC9' | set drag over background color |
klass | String | set append tree class |
Method | Params |
---|---|
addChild | (object) newDataItem |
addAfter | (object) newDataItem, (object) selectedNode |
addBefore | (object) newDataItem, (object) selectedNode |
openChildren | |
closeChildren |
@item-click(node, item, e)
@item-toggle(node, item, e)
@item-drag-start(node, item, e)
@item-drag-end(node, item, e)
@item-drop(node, item, draggedItem, e)
node : current node vue object item : current node data item object e : event
Name | Type | Default | Describe |
---|---|---|---|
icon | String | custom icon css class | |
opened | Boolean | false | set leaf opened |
selected | Boolean | false | set node selected |
disabled | Boolean | false | set node disabled |
isLeaf | Boolean | false | if node is a leaf , set true can hide '+' |
dragDisabled | Boolean | false | selective drag |
dropDisabled | Boolean | false | selective drop |
Licensed under the MIT license.
Thanks For jstree's UI
FAQs
a tree plugin for vue2
The npm package vue-jstree receives a total of 656 weekly downloads. As such, vue-jstree popularity was classified as not popular.
We found that vue-jstree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.