tree slot-scope自定义内容

tree slot-scope自定义内容

https://blog.csdn.net/bamboozjy/article/details/82344004 //table树

<template>

<div >

{{msg}}

<el-tree

:

show-checkbox

node-key="id"

:default-expanded-keys="[2, 3]"

:default-checked-keys="[5]"

:props="defaultProps">

<span slot-scope="{node,data}">

<span >0000{{data.id}}</span>

</span>

</el-tree>

</div>

</template>


<script>

export default {

name: ‘HelloWorld‘,

data () {

return {

msg: ‘Welcome to Your Vue.js App‘,

data2: [{

id: 1,

label: ‘一级 1‘,

children: [{

id: 4,

label: ‘二级 1-1‘,

children: [{

id: 9,

label: ‘三级 1-1-1‘

}, {

id: 10,

label: ‘三级 1-1-2‘

}]

}]

}, {

id: 2,

label: ‘一级 2‘,

children: [{

id: 5,

label: ‘二级 2-1‘

}, {

id: 6,

label: ‘二级 2-2‘

}]

}, {

id: 3,

label: ‘一级 3‘,

children: [{

id: 7,

label: ‘二级 3-1‘

}, {

id: 8,

label: ‘二级 3-2‘

}]

}],

defaultProps: {

children: ‘children‘,

label: ‘label‘

}

}

}

}

</script>


<style scoped>

</style>

免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部