/* eslint no-console:0 */ /* eslint no-alert:0 */ import PropTypes from '../../_util/vue-types' import Tree, { TreeNode } from '../index' import '../assets/index.less' import './basic.less' export default { props: { keys: PropTypes.array.def(['0-0-0-0']), }, data () { const keys = this.keys return { defaultExpandedKeys: keys, defaultSelectedKeys: keys, defaultCheckedKeys: keys, switchIt: true, } }, methods: { onExpand (expandedKeys) { console.log('onExpand', expandedKeys, arguments) }, onSelect (selectedKeys, info) { console.log('selected', selectedKeys, info) this.selKey = info.node.$options.propsData.eventKey }, onCheck (checkedKeys, info) { console.log('onCheck', checkedKeys, info) }, onEdit () { setTimeout(() => { console.log('current key: ', this.selKey) }, 0) }, onDel (e) { if (!window.confirm('sure to delete?')) { return } e.stopPropagation() }, toggleChildren () { this.showMore = !this.showMore }, }, render () { const customLabel = ( operations: Edit Delete ) return (