iview实现select tree树形下拉框的示例代码

这篇文章主要介绍了iview实现select tree树形下拉框的示例代码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

本文介绍了iview实现select tree树形下拉框的示例代码,分享给大家,具体如下:

html部分

 

数据部分

 export const treeData= [ { title: 'parent 1', expand: true, selected: true, value: '1', children: [ { title: 'parent 1-1', expand: true, value: '11', children: [ { value: '111', title: 'leaf 1-1-1' }, { value: '112', title: 'leaf 1-1-2' } ] }, { title: 'parent 1-2', value: '12', expand: true, children: [ { value: '121', title: 'leaf 1-2-1' }, { value: '122', title: 'leaf 1-2-2' } ] } ] } ];

js部分

 // 子节点的option renderContent (h, { root, node, data }) { return h('Option', { style: { display: 'inline-block', margin: '0' }, props:{ value: data.value } }, data.title); }, 

以上就是iview实现select tree树形下拉框的示例代码的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » Vue.js 教程