Closed m-mazeev closed 6 years ago
@m-mazeev Hi!
You are missing some props here. Try this:
<template>
<div id="app">
<TreeView
:model="model"
category="children"
:selection="selection"
:onSelect="onSelect"
:display="display"
/>
</div>
</template>
<script>
import { TreeView } from "@bosket/vue"
import { string } from "@bosket/tools"
export default {
name: 'test-bosket',
components: {
"TreeView": TreeView
},
methods: {
onSelect(newSelection) {
this.selection = newSelection
},
display(item) {
return item.label
}
},
data: function() {
return {
selection: [],
category: "children",
model: [{
label: "Animals",
children: [{
label: "Mammals",
children: [
{ label: "Tiger" },
{ label: "Platypus" },
{ label: "Bear" }
]
}, {
label: "Reptiles",
children: [
{ label: "Turtle" },
{ label: "Crocodile" }
]
}]
}]
}
}
}
</script>
<style>
/* CSS */
</style>
Thanks. Now it works.
Hi. I have a problem with model.
When I try to run app? I have error.
Can you help me solve this problem?