iview/test/routers/tree.vue

46 lines
1.2 KiB
Vue
Raw Normal View History

<template>
2017-02-07 11:34:00 +08:00
<Tree
:data.sync="treeData"
2017-02-07 13:34:16 +08:00
:show-checkbox="true"
2017-02-07 11:34:00 +08:00
:multiple="true"
:on-select="selectFn"
:on-check="checkFn"></Tree>
</template>
<script>
export default {
2017-02-07 11:34:00 +08:00
data: function() {
return {
treeData: [{
title: 'parent 1',
selected: false,
node: [{
title: 'parent 1-0',
expand: true,
disabled: true,
node: [{
title: 'leaf',
disableCheckbox: true
}, {
title: 'leaf',
}]
}, {
title: 'parent 1-1',
checked: true,
node: [{
title: '<span style="color: red">sss</span>',
}]
}]
}]
}
},
2017-02-07 11:34:00 +08:00
methods: {
selectFn(data){
2017-02-07 13:34:16 +08:00
// console.log(data);
2017-02-07 11:34:00 +08:00
},
checkFn(data){
2017-02-07 13:34:16 +08:00
// console.log(data);
2017-02-07 11:34:00 +08:00
}
}
}
</script>