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