element的树状控件在vue中如何自定义并默认展开?

 <el-tree
          :data="data2"
          show-checkbox
          default-expand-all
          node-key="id"
          ref="tree"
          highlight-current
          check-on-click-node
          :props="defaultProps">
        </el-tree>
        data2: [{
          label: '全选',
          children: [
            {
              label: "_id",
              disabled: true
            }
            , {
              label: 'name'
            }, {
              label: 'sex'
            }, {
              label: 'address'
            }, {
              label: "mobile"
            }, {
              label: "year"
            }, {
              label: "nation"
            }, {
              label: "major"
            }, {
              label: "username"
            }, {
              label: "headPicture"
            }
          ]
        }],
        defaultProps: {
          children: this.children,
          label: 'label'
        },

猜你喜欢

转载自blog.csdn.net/qq_42427109/article/details/84975142