1.前端代码 renderContent(h, data) {//return data.label;//debuggerif(data.typeName == "楼栋长"){return( )/*return ( {data.label} {data.phone} 包靠楼栋: {data.buildName} );*/}elseif(data.typeName == "一级"){return(...
horizontal":collapsable="collapsable":label-class-name="labelClassName":render-content="renderContent"name="organ"@on-expand="onExpand"@on-node-click="onNodeClick"/></el-scrollbar></template>exportdefault{name:"TreeTest",data() {return{"treeData": {labelClassName:"bg-color-orange",basicInfo...
可以通过render-content属性自定义节点的内容。例如: html <vue2-org-tree :data="treeData" :render-content="renderContent" /> 在Vue组件的methods中定义renderContent方法: javascript methods: { renderContent(h, data) { return h('div', [ h('span', data.label), h('br'), h('span'...
renderContent how to render node label Function - labelClassName node label class Function | String - selectedKey The key of the selected node String - selectedClassName The className of the selected node Function | String - events event namedescriptontype click Click event Function mouseover onMou...
通过鼠标点击展开下拉菜单。点击子菜单可以实现不同的功能。我让每一个节点都是一个下拉菜单,不就可以了吗?把上面的代码改写成jsx形式,并写入renderContent方法里,记得定义组件renderContent属性哦。 renderContent (h, data) {return( {data.title} this.onClick(key, data)}> ...