其他分享
首页 > 其他分享> > el-main中增加新增,删除等按钮

el-main中增加新增,删除等按钮

作者:互联网

1.增加代码:

        <!--两个div层之间都用margin,则会自动隔开-->
        <div style="margin: 10px 0px">
          <el-button type="primary">新增 <i class="el-icon-circle-plus-outline"></i></el-button>
          <el-button type="danger">批量删除 <i class="el-icon-remove-outline"></i></el-button>
          <el-button type="primary">导入 <i class="el-icon-bottom"></i></el-button>
          <el-button type="primary">导出 <i class="el-icon-top"></i></el-button>
        </div>

 

2.增加后el-main的代码:

      <el-main>
        <div style="padding: 10px 0px">
          <!--prefix-icon="el-icon-user",表示加一个搜素图标,设置在头-->
          <!--suffix-icon="el-icon-tickets"",表示加一个搜素图标,设置在尾-->
          <!--placeholder="请输入内容"",表示设置一个默认显示提示文字内容-->
          <el-input style="width: 200px" placeholder="请输入人名" prefix-icon="el-icon-user"></el-input>
          <el-input style="width: 200px" placeholder="请输入标题" suffix-icon="el-icon-tickets" class="ml-5"></el-input>
          <el-input style="width: 200px" placeholder="请输入url"  prefix-icon="el-icon-link " class="ml-5"></el-input>
          <el-button class="ml-5" type="primary">搜索</el-button>
        </div>

        <!--两个div层之间都用margin,则会自动隔开-->
        <div style="margin: 10px 0px">
          <el-button type="primary">新增 <i class="el-icon-circle-plus-outline"></i></el-button>
          <el-button type="danger">批量删除 <i class="el-icon-remove-outline"></i></el-button>
          <el-button type="primary">导入 <i class="el-icon-bottom"></i></el-button>
          <el-button type="primary">导出 <i class="el-icon-top"></i></el-button>
        </div>

        <!--border stripe,表示加上斑马线-->
        <!--header-row-class-name="headerBg",表示设置表头颜色样式,headerBg为一个style样式类-->
        <el-table :data="tableData" border stripe :header-cell-class-name="headerBg">
          <el-table-column prop="date" label="日期" width="140">
          </el-table-column>
          <el-table-column prop="name" label="姓名" width="120">
          </el-table-column>
          <el-table-column prop="address" label="地址">
          </el-table-column>
        </el-table>
        <div style="padding: 10px 0px">    <!--内边距空一些-->
          <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage4"
                  :page-sizes="[5, 10, 15, 20]"
                  :page-size="10"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="400">
          </el-pagination>
          <!--1.page-sizes一般设置为5,10,15,20-->
          <!--1.page-size一般设置为10,即每页10个-->
        </div>
      </el-main>

 

标签:el,删除,导出,新增,导入,按钮,main
来源: https://www.cnblogs.com/jingzaixin/p/16390365.html