iview/examples/routers/tree.vue

56 lines
1.7 KiB
Vue
Raw Permalink Normal View History

<template>
2019-10-09 16:41:00 +08:00
<div>
<Tree ref="treeRef" :data="data4" show-checkbox multiple></Tree>
<Button @click="get">
get
</Button>
</div>
</template>
<script>
export default {
2017-03-03 10:35:38 +08:00
data () {
2017-02-07 11:34:00 +08:00
return {
2019-10-09 16:41:00 +08:00
data4: [
2017-03-24 20:50:13 +08:00
{
2019-10-09 16:41:00 +08:00
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'
}
]
}
]
2019-08-29 11:42:30 +08:00
}
]
2019-10-09 16:41:00 +08:00
}
2019-08-29 11:42:30 +08:00
},
methods: {
2019-10-09 16:41:00 +08:00
get(){
console.log(this.$refs.treeRef.getCheckedNodes())
2017-10-23 11:55:35 +08:00
}
2017-02-07 11:34:00 +08:00
}
2019-10-09 16:41:00 +08:00
}
2017-10-25 22:34:58 +08:00
</script>