el-tree render-content 非jsx实现方法,

renderContent(h, { node, data, store }) {
                return h('span',{class:'custom-tree-node error'},
	        				[
	        					h('span',[
	        						h('span',{domProps:{
	        	                         innerHTML:node.data.label
	        	                     }}),
	        	                    h('span',{class:'oper'},[
	        	                    	h('img',{domProps:{
	        	                    		src:"<%=path%>/images/tree-add.png"
	        	                       },
	        	                      on: {
	        	                    	 click: () => {
	        	                    		this.append(node.data)
	        	                    	 }
	        	                    	 }
	        	                       }),
	        	                      h('img',{domProps:{
        	                    		src:"<%=path%>/images/tree-edit.png"
        	                       },
        	                       on: {
 	        	                    	 click: () => {
 	        	                    		this.edit(node,node.data)
 	        	                    	 }
 	        	                    	 }
	        	                      }),
        	                       h('img',{domProps:{
        	                    		src:"<%=path%>/images/tree-delete.png"
        	                       },
        	                       on: {
 	        	                    	 click: () => {
 	        	                    		this.remove(node,node.data)
 	        	                    	 }
 	        	                    	 }
        	                       })
	        	                    ])
	        					])
	        				])
    }
发布了24 篇原创文章 · 获赞 0 · 访问量 1106

猜你喜欢

转载自blog.csdn.net/shixueyan_fendou/article/details/103593676
今日推荐