/* eslint react/no-multi-comp:0, no-console:0 */ import '../assets/index.less'; import './demo.less'; import TreeSelect, { SHOW_PARENT } from '../index'; import Gen from './big-data-generator'; export default { data() { return { gData: [], gData1: [], value: '', value1: '', }; }, methods: { onChange(value) { console.log('onChange', arguments); this.value = value; }, onChangeStrictly(value1) { console.log('onChangeStrictly', arguments); const ind = parseInt(Math.random() * 3, 10); value1.push({ value: `0-0-0-${ind}-value`, label: `0-0-0-${ind}-label`, halfChecked: true }); this.value1 = value1; }, onGen(data) { Object.assign(this.$data, { gData: data, gData1: [...data], value: '0-0-0-value', value1: [ { value: '0-0-value', label: '0-0-label', halfChecked: true }, { value: '0-0-0-value', label: '0-0-0-label' }, ], // value: ['0-0-0-0-value', '0-0-0-1-value', '0-0-0-2-value'], }); }, }, render() { return (

normal check

请下拉选择} treeCheckable showCheckedStrategy={SHOW_PARENT} onChange={this.onChange} __propsSymbol__={Symbol()} />

checkStrictly

请下拉选择} treeCheckable treeCheckStrictly showCheckedStrategy={SHOW_PARENT} onChange={this.onChangeStrictly} __propsSymbol__={Symbol()} />
); }, };