| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- Page({
- data: {
- treeList: [{
- id: '1',
- pid: '0',
- name: '祖先节点',
- nodes: [{
- id: '1-1',
- pid: '1',
- name: '父节点1',
- nodes: [{
- id: '1-1-1',
- pid: '1-1',
- name: '子节点1',
- nodes: [{
- id: '1-1-1-1',
- pid: '1',
- name: '父节点1',
- nodes: [{
- id: '1-1-1-1-1',
- pid: '1-1',
- name: '子节点1',
- nodes: []
- }]
- },
- {
- id: '1-1-2',
- pid: '1',
- name: '父节点2',
- nodes: [{
- id: '1-1-2',
- pid: '1-1',
- name: '子节点2',
- nodes: []
- }]
- }
- ]
- }]
- },
- {
- id: '1-2',
- pid: '1',
- name: '父节点2',
- nodes: [{
- id: '1-1-2',
- pid: '1-1',
- name: '子节点2',
- nodes: []
- }]
- }
- ]
- }]
- },
- treeClick(e) {
- console.log(e)
- const t = this.selectAllComponents('#treeSelect');
- t.forEach(item => {
- item.click(e);
- console.log(e.detail)
- })
- const {
- id,
- value
- } = e.detail;
- console.log(e.detail)
- }
- })
|