Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added treeitem role to tree items. Updated a few devDependencies. #182

Merged
merged 8 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into master
  • Loading branch information
Isaac Vargas authored Dec 19, 2019
commit c28ffb460583ecc5e13258abfa0440a63d6a442e
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "liquor-tree",
"version": "0.2.69",
"description": "A Vue.js tree component.",
"version": "0.2.70",
"author": "Kostiantyn <phlyze@gmail.com>",
"scripts": {
"lint": "vue-cli-service lint",
Expand Down
6 changes: 2 additions & 4 deletions src/components/TreeNode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@
<ul
v-if="hasChildren() && node.states.expanded"
class="tree-children"
>
<template v-for="child in node.children">
>
<node
v-if="child && child.visible()"
v-for="child in visibleChildren"
:key="child.id"
:node="child"
:options="options"
/>
</template>
</ul>
</transition>
</li>
Expand Down
45 changes: 29 additions & 16 deletions src/components/TreeRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,20 @@
@dragstart="onDragStart"
>
<template v-if="opts.filter.plainList && matches.length > 0">
<template v-for="node in matches">
<TreeNode
v-if="node.visible()"
:key="node.id"
:node="node"
:options="opts"
/>
</template>
<TreeNode
v-for="node in visibleMatches"
:key="node.id"
:node="node"
:options="opts"
/>
</template>
<template v-else>
<template v-for="node in model">
<TreeNode
v-if="node && node.visible()"
:key="node.id"
:node="node"
:options="opts"
/>
</template>
<TreeNode
v-for="node in visibleModel"
:key="node.id"
:node="node"
:options="opts"
/>
</template>
</ul>
</template>
Expand Down Expand Up @@ -117,7 +113,24 @@
default: 'div'
}
},
watch: {
filter (term) {
this.tree.filter(term)
}
},
computed: {
visibleModel() {
return this.model.filter(function(node) {
return node && node.visible()
})
},

visibleMatches() {
return this.matches.filter(function(node) {
return node && node.visible()
})
}
},
data () {
// we should not mutating a prop directly...
// that's why we have to create a new object
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.