2017-02-06 11:24:03 +08:00
|
|
|
<template>
|
2017-03-24 20:50:13 +08:00
|
|
|
<Tree :data="baseData" @on-select-change="handleSelectChange" show-checkbox></Tree>
|
2017-02-06 11:24:03 +08:00
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
2017-03-03 10:35:38 +08:00
|
|
|
data () {
|
2017-02-07 11:34:00 +08:00
|
|
|
return {
|
2017-03-24 20:50:13 +08:00
|
|
|
baseData: [
|
|
|
|
{
|
2017-02-07 11:34:00 +08:00
|
|
|
expand: true,
|
2017-03-24 20:50:13 +08:00
|
|
|
title: 'parent 1',
|
2017-02-07 15:29:53 +08:00
|
|
|
children: [{
|
2017-03-24 20:50:13 +08:00
|
|
|
title: 'parent 1-0',
|
|
|
|
expand: true,
|
|
|
|
// disabled: true,
|
|
|
|
// checked: true,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
title: 'leaf',
|
|
|
|
checked: true,
|
|
|
|
selected: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'leaf',
|
|
|
|
checked: false
|
|
|
|
}
|
|
|
|
]
|
2017-02-07 11:34:00 +08:00
|
|
|
}, {
|
2017-03-24 20:50:13 +08:00
|
|
|
title: 'parent 1-1',
|
|
|
|
expand: true,
|
|
|
|
checked: true,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
title: '<span style="color: red">leaf</span>',
|
|
|
|
checked: false
|
|
|
|
}
|
|
|
|
]
|
2017-02-07 11:34:00 +08:00
|
|
|
}]
|
2017-03-24 20:50:13 +08:00
|
|
|
},
|
|
|
|
// {
|
|
|
|
// expand: true,
|
|
|
|
// title: 'parent 1',
|
|
|
|
// children: [{
|
|
|
|
// title: 'parent 1-0',
|
|
|
|
// expand: true,
|
|
|
|
// children: [{
|
|
|
|
// title: 'leaf'
|
|
|
|
// }, {
|
|
|
|
// title: 'leaf',
|
|
|
|
// }]
|
|
|
|
// }, {
|
|
|
|
// title: 'parent 1-1',
|
|
|
|
// expand: true,
|
|
|
|
// checked: true,
|
|
|
|
// children: [{
|
|
|
|
// title: '<span style="color: red">leaf</span>',
|
|
|
|
// }]
|
|
|
|
// }]
|
|
|
|
// }
|
|
|
|
]
|
2017-02-07 11:34:00 +08:00
|
|
|
}
|
2017-03-03 11:35:33 +08:00
|
|
|
},
|
|
|
|
methods: {
|
2017-03-24 20:50:13 +08:00
|
|
|
handleSelectChange (data) {
|
|
|
|
console.log(data);
|
2017-03-03 11:35:33 +08:00
|
|
|
}
|
2017-02-07 11:34:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|