update
This commit is contained in:
parent
f3893b007d
commit
1183836a92
1 changed files with 30 additions and 31 deletions
|
@ -1,36 +1,48 @@
|
||||||
<template>
|
<template>
|
||||||
<Tree :data="baseData" show-checkbox @on-check-change="handleChange" @on-toggle-expand="showExpand"></Tree>
|
<Tree :data="db" show-checkbox></Tree>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
bd: [],
|
db:[
|
||||||
baseData: [
|
|
||||||
{
|
{
|
||||||
title: 'parent',
|
title: '父级',
|
||||||
id: '1-0',
|
checked: false,
|
||||||
expand: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
title: 'child1',
|
title: '孩子',
|
||||||
id: '1-1',
|
checked: false,
|
||||||
expand: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
title: 'child1-1-1',
|
title: '孙子',
|
||||||
id: '1-1-1'
|
checked: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'child1-1-2',
|
title: '孙子',
|
||||||
id: '1-1-2'
|
checked: false,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: '曾孙',
|
||||||
|
checked: false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '其他',
|
||||||
|
checked: false,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
title: '其他孩子',
|
||||||
|
checked: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'child2',
|
title: '其他孩子2',
|
||||||
id: '1-2',
|
checked: true
|
||||||
children: []
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -38,23 +50,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSelectChange (data) {
|
|
||||||
console.log(data);
|
|
||||||
},
|
|
||||||
updateTree (data) {
|
|
||||||
data[0].children[0].checked = true;
|
|
||||||
// data[0].children[0].children[0].checked = true;
|
|
||||||
// data[0].children[0].children[1].checked = true;
|
|
||||||
},
|
|
||||||
handleChange () {
|
|
||||||
console.log(1)
|
|
||||||
},
|
|
||||||
showExpand (payload) {
|
|
||||||
console.log(payload)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.updateTree(this.baseData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue