树状表格---vue-table-with-tree-grid - 前端笔记-1.安装 npmivue-table-with-tree-grid-S 2.引入 //注册全局树状表格 importtree&nb...

学习笔记

点滴记忆
回忆过往
首页>> web前端 >>树状表格---vue-table-with-tree-grid - 前端笔记
1.安装
    npm i vue-table-with-tree-grid -S
2.引入 
//注册全局树状表格
import tree from 'vue-table-with-tree-grid'
Vue.component('tree'tree)



3.在页面中使用
  <tree></tree>



4.小案例   (属性方法参考百度)
  <tree
        ref="table"
        sum-text="sum"
        index-text="#"
        :data="data"
        :columns="columns"
        :show-summary="props.showSummary"
        :show-row-hover="props.showRowHover"
        :show-index="true"
        :tree-type="props.treeType"
        :is-fold="props.isFold"
        :expand-type="props.expandType"
        :selection-type="props.selectionType"
      >
        <template slot="sex" scope="sex">
          <el-tag v-if="sex.row.cat_level == 0"> 一级</el-tag>
          <el-tag v-if="sex.row.cat_level == 1" type="success"> 二级</el-tag>
          <el-tag v-if="sex.row.cat_level == 2" type="warning"> 三级</el-tag>
        </template>

        <template slot="likes" scope="scope">
          <el-row>
            <!-- //编辑 -->
            <el-button
              type="primary"
              icon="el-icon-edit"
              size="mini"
              @click="bj(scope.row.cat_id)"
            >
              编辑
            </el-button>
            <!-- 删除 -->
            <el-button
              type="warning"
              icon="el-icon-edit"
              size="mini"
              @click="remove(scope.row.cat_id)"
            >
              删除
            </el-button>
            <!-- 权限分配 -->
            <!-- <el-button type="success" icon="el-icon-edit" size="mini">
              权限分配
            </el-button> -->
          </el-row>
        </template>

        <template slot="score" scope="scope">
          <el-tag v-if="scope.row.cat_level == 0"> 一级</el-tag>
          <el-tag v-if="scope.row.cat_level == 1" type="success"> 二级</el-tag>
          <el-tag v-if="scope.row.cat_level == 2" type="warning"> 三级</el-tag>
        </template>
      </tree>

×

感谢您的支持,我们会一直保持!

扫码支持
请土豪扫码随意打赏

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

打赏作者
版权所有,转载注意明处:前端笔记 » 树状表格---vue-table-with-tree-grid

网友评论(0)