欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

iview Tree组件点击高亮

程序员文章站 2024-03-12 20:05:44
...

.selectTreeClass{
background:#ebf7ff;
}

renderContent(h: any, {root , node, data }: any) {
return h(“div”,{
style: {
width: “90%”,
float:“right”,
cursor:“pointer”,
padding:“3px”,
},
attrs:{
class:(data.nodeKey == 0 ? ‘show selectTreeClass’:‘show’)
},
on: {
click: () => {

                          (this as any).oilPoint(root, node, data);
                        }
                    }
                },
                [
                    h("div",[
                        h("Icon", {
                            props: {
                                type: "ios-folder",
                                size:"16"
                            },
                            style: {
                                marginRight: "8px",
                                float:"left",
                                color:'#add0f6',
                               
                            }
                        }),
                        h("span",{
                            style: {
                                marginRight: "30px",
                                float:"left",
                            },
                            on: {
                                click: (e:any) => {
                                    $(".show").removeClass("selectTreeClass");
                                    $(e.target).parents(".show").addClass("selectTreeClass");
                                    (this as any).showModal(root, node, data);
                                }
                            }
                         }, data.title)
                    ]),
                ]
            );
        },
相关标签: iview