2

<!DOCTYPE html>
<html class="over_hidd">

<head>
    <meta charset="UTF-8">
    <title>vue+element后台系统"</title>        
    <meta name="Author" content="Lee">
    <meta name="Keywords" content="vue+element后台系统">
    <link rel="stylesheet" href="css/public.css" />
    <link rel="stylesheet" href="css/element.css" />
</head>
<body class="over_hidd">
    <div id="app">
        <el-tree
              :data="data2"
              show-checkbox
              node-key="id"
              :default-expanded-keys="[2, 3]"
              :default-checked-keys="[5]"
              :props="defaultProps">
        </el-tree>
    </div>
</body>
<script type="text/javascript" src="js/vue.js" ></script>
<script type="text/javascript" src="js/element.js" ></script>
<script>
    new Vue({
        el: '#app',
        data() {
              return {
                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>

</html>

作者:攻城狮Lee丶
来源:CSDN
原文:https://blog.csdn.net/zhuogan...
版权声明:本文为博主原创文章,转载请附上博文链接!


攻城狮Lee丶
2.8k 声望19 粉丝

90后码农一枚。关注互粉。