• 日常前端记录,下拉框自定义table


    <template>
      <div class="hello">
         <el-form  inline size="small">
              <el-form-item label="学校">
                     <el-select v-model="title" multiple  filterable clear placeholder="请选择"  style="position: relative; 428px;">
                       <el-option v-for="(item,index) in livelist" :key="item.id" :label="item.name" :value="item.id"></el-option>
                       <div class="text-center" style="position:absolute;background: #fff;height:36px;bottom:0;z-index:1000;left:0;100%;">
                            <el-pagination
                              background
                                 @size-change="handleSizeChange"
                                 @current-change="handleCurrentChange"
                                 :current-page="currentPage"
                                 :page-sizes="pageSizeOpts"
                                 :page-size="pageSize"
                                 layout="total, sizes, prev,slot,next, jumper"
                                 :total="total">
                                 <span class="current-number">{{currentPage}}</span>
                               </el-pagination>
                       </div>
                     </el-select>
            </el-form-item>
          </el-form>
      </div>
    </template>
    
    <script>
    export default {
      name: 'HelloWorld',
      data () {
        return {
          msg: 'Welcome to Your Vue.js App',
          livelist:[],
          title:[],
          currentPage: 1,
          pageSize: 10,
          pageSizeOpts: [10, 15,20],
          total:0,
        }
      },
      created(){
        var that=this;
        that.getLiveList();
      },
      methods: {
           handleSizeChange(val) {
              console.log(`每页 ${val} 条`);
              var that=this;
              that.pageSize=val;
              that.currentPage=1;
              that.getLiveList();
            },
            handleCurrentChange(val) {
              console.log(`当前页: ${val}`);
              var that=this;
              that.currentPage=val;
              that.getLiveList();
            },
            searchLive(){
              var that=this;
              that.currentPage=1;
              that.getLiveList();
            },
            getLiveList(){
              var that=this;
              let datalist = [];
              let param = {
              	page: that.currentPage,
              	size: that.pageSize,
              	cid: '0',
              	title: that.title,
              	status:'all'
              };
              that.$http.get("/admin/listmlive/", {
              	params: param
              }).then(function(res) {
                  console.log(res);
                  if(res.data.status == 'yes') {
                  	var list = res.data.livelist;
                  	for(let i = 0; i < list.length; i++) {
                  		datalist.push(list[i]);
                  	}
                  } else {
                  	datalist = [];
                  }
                  that.total= res.data.count;
                  that.livelist=datalist;
              }).catch(function(err) {
              	console.log(err)
              })
            }
          }
    }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped>
    h1, h2 {
      font-weight: normal;
    }
    ul {
      list-style-type: none;
      padding: 0;
    }
    li {
      display:block;
      margin: 0 10px;
    }
    a {
      color: #42b983;
    }
    </style>
    <style>
    .el-select-dropdown__wrap{
        max-height: 360px!important;
    }
    .current-number{text-align: center;color:#007AFF}
    </style>
    

      

  • 相关阅读:
    Python安装及编辑器UliPad安装
    安装配置Django开发环境(Eclipse + Pydev)
    VsSDK_sfx.exe 安装出错
    [转]代码分析工具FxCop1.36之一:介绍与使用
    [转]IBM Rational系列产品介绍
    [转]C#控件——DataGridView单元格文本自动换行
    [转]FrameWork4.0的兼容问题 .
    【整理】C# ToString格式字符串整理(Format)(数字、日期和枚举的标准格式设置说明符)(SamWang)
    [转]史上最好的20本敏捷开发书籍
    [转]C#数字千分位问题
  • 原文地址:https://www.cnblogs.com/xmyfsj/p/12216066.html
Copyright © 2020-2023  润新知