Home > front end >  Two big click event contains little click events but for the first time, click on the small the clic
Two big click event contains little click events but for the first time, click on the small the clic

Time:10-11



<script>
Export the default {
Name: "Treebranch,"
Data () {
Return {
TitleList: [
/* {
Title: 'page 1',
ChildrenList: [
{
Add: 'function 1-1'
},
{
Add: 'function 1-2'
}
]
}, */
],
Data: [
{
Id: 1,
Label: "1",
Idlast: false,
Children:
{
Id: 4,
Label: "secondary 1-1,"
Idlast: false,
Children:
{
Id: 9,
Label: "level 3 1-1-1,"
Idlast: true
},
{
Id: 100000,
Label: "level 3 1-1-2,"
Idlast: true,
},
]
}
]
},
{
Id: 2,
Label: "level 2",
Idlast: false,
Children:
{
Id: 5,
Label: "secondary 2-1,"
Idlast: false,
Children:
{
Id: 11,
Label: "level 2, 2-1-1,"
Idlast: true
},
{
Id: 12,
Label: "level 2, 2-1-2,"
Idlast: true
}
]
},
{
Id: 6,
Label: "secondary 2-2",
Idlast: true
}
]
},
{
Id: 3,
Label: "level 3",
Idlast: false,
Children:
{
Id: 7,
Label: "secondary 3-1",
Idlast: true
},
{
Id: 8,
Label: "secondary 3-2",
Idlast: true
}
]
}
],


/* the font: "el - icon - folder," */

DefaultProps: {
Children: "children,"
Label: "label"
}
};
},

Methods: {
HandleNodeClick (data, e) {
Var that=this
//the console. The log (data);
The console. The log (e);
Let the tree=this. $refs. Tree;
/* e.c. with our fabrication: hecked=! Hecked; of e.c. with our fabrication: */
The console. The log (tree);
Enclosing treeKey="";//initialize
Enclosing breadList=[];//initialize
if (! Um participant roups) {
Enclosing getTreeNode (tree. GetNode (e.k ey));
Enclosing treeKey=e.k ey.
Enclosing treeGroupType=um participant roupType;
The console. The log (enclosing breadList [this. BreadList. Length - 1]).
Var id=this. BreadList [this. BreadList. Length - 1]//generated below the right div the id with which we call interface
}

Var ozi=document. GetElementsByClassName (" zi ");
The console. The log (ozi);
Var oipt=document. GetElementsByClassName (" ipt ");
The console. The log (oipt);


For (the let I=0; i
Ozi [I] index=I;
Ozi [I] onclick=function (e) {

If (e & amp; & E.s topPropagation) {
E.s topPropagation ()
} else {
Window. The event. The cancelBubble=true
}


The console. The log (ozi [this index], "chan");
Oipt [this index]. Checked=! Oipt [this index]. Checked;
If (oipt [this index]. Checked==true) {
The console. The log (id)//generated right div the id with which we call interface
Let the add={
Title: 'page 1',
ChildrenList: [
{
Add: 'function 1-1'
},
{
Add: 'function 1-2'
},
{
Add: 'function 1-2'
},
]
}
That. TitleList. Push (add)
} else {
That. TitleList. Splice (this index, 1)
}
};
}


},


GetTreeNode (node) {
//get the current tree node and the parent node
If (node) {
If (the node label!==undefined) {
The console. The log (node. Key)
This. BreadList. Unshift (node. Key);//add elements in the array head
Enclosing getTreeNode (node. The parent);//recursive
}
}
},
RenderContent: function (h, {node, the data and store}) {
Var createElement method=the arguments [0];
Var level=the arguments [1]. The node. The level;
The console. The log (the arguments [1]. The node. Data);
If (node. Data. Idlast==false) {
Return createElement method (" span ", [
//the createElement method (" I ", {attrs: {class: "folder"}}),
/* */
CreateElement method (" span ", the arguments [1]. The node. The label)
]);
} else {
Return createElement method (" span ", {attrs: {style: 'background: # 1 d304c; color:white; Padding: 0 px; Border - the radius: 4 px 'class: "zi"}}, [
The createElement method (" input ", {attrs: {type: "checkbox," class: "the ipt," style: 'margin - right: 5 px'}}),

CreateElement method (" span ", the arguments [1]. The node. The label)
]);
}
}
}
};
</script>
<style lang="SCSS scoped>";
. Childmenu_container {
Margin - top: 10 px;
Width: 150 px;
Min - height: 600 px;
background: #fff;
display: flex;
}

. Childmenu_container. Zi {
Background: # 1 d304c;
}
. Childmenu_container. Show {
display: flex;
Overflow - x: auto;
Height: 200 px;


}
. Childmenu_container. Show - zi {
Height: 178 px;
Overflow - y: auto;
text-align: center; nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related