bug fixed #6121
This commit is contained in:
parent
a6068736cb
commit
b93725bbb9
2 changed files with 51 additions and 71 deletions
|
@ -1,81 +1,55 @@
|
|||
<template>
|
||||
<Tree :data="data3" :load-data="loadData" show-checkbox></Tree>
|
||||
<div>
|
||||
<Tree ref="treeRef" :data="data4" show-checkbox multiple></Tree>
|
||||
<Button @click="get">
|
||||
get
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//验证bug #6139
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
data3: [
|
||||
data4: [
|
||||
{
|
||||
title: 'parent',
|
||||
loading: false,
|
||||
children: []
|
||||
title: 'parent 1',
|
||||
expand: true,
|
||||
children: [
|
||||
{
|
||||
title: 'parent 1-1',
|
||||
expand: true,
|
||||
children: [
|
||||
{
|
||||
title: 'leaf 1-1-1',
|
||||
checked : false,
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
title: 'leaf 1-1-2'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: 'parent 1-2',
|
||||
expand: true,
|
||||
children: [
|
||||
{
|
||||
title: 'leaf 1-2-1',
|
||||
},
|
||||
{
|
||||
title: 'leaf 1-2-1'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadData (item, callback) {
|
||||
setTimeout(() => {
|
||||
const isSet = Math.ceil(Math.random()*10)%2;
|
||||
let data = [];
|
||||
if( isSet ){
|
||||
data = [
|
||||
{
|
||||
title: 'children-1',
|
||||
loading: false,
|
||||
children: []
|
||||
}
|
||||
];
|
||||
}
|
||||
callback(data);
|
||||
}, 1000);
|
||||
get(){
|
||||
console.log(this.$refs.treeRef.getCheckedNodes())
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<!--<template>-->
|
||||
<!-- <Tree :data="data2" check-directly show-checkbox></Tree>-->
|
||||
<!--</template>-->
|
||||
<!--<script>-->
|
||||
<!-- export default {-->
|
||||
<!-- data () {-->
|
||||
<!-- return {-->
|
||||
<!-- data2: [-->
|
||||
<!-- {-->
|
||||
<!-- title: 'parent 1',-->
|
||||
<!-- expand: true,-->
|
||||
<!-- children: [-->
|
||||
<!-- {-->
|
||||
<!-- title: 'parent 1-1',-->
|
||||
<!-- expand: true,-->
|
||||
<!-- children: [-->
|
||||
<!-- {-->
|
||||
<!-- title: 'leaf 1-1-1'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: 'leaf 1-1-2'-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: 'parent 1-2',-->
|
||||
<!-- expand: true,-->
|
||||
<!-- children: [-->
|
||||
<!-- {-->
|
||||
<!-- title: 'leaf 1-2-1'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: 'leaf 1-2-1'-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--</script>-->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue