1.0.0 • Published 5 years ago

el-table-page v1.0.0

Weekly downloads
3
License
-
Repository
-
Last release
5 years ago

element-table

table component with pagination

How to use

npm i el-table-page -S
/* ignore this if you include element-table.js by <script> tag from a cdn, such as unpkg */
import Vue from 'vue'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import ElementTablePagination from 'el-table-page/src/components/element-table.vue'
import Page from 'el-table-page/src/utils/page.js'

Vue.use(Element)
Vue.component('el-table-page', ElementTablePagination)

// Vue.use(ElementTablePagination)
Vue.use(Page)
<el-table-page
  :page="page"
  :search="getSearchModel"
  :url="url">
    <!-- content goes here -->
    <el-table :data="page.list">
    <el-table-column label="模版名称" prop="templateName" show-overflow-tooltip>
      <template slot-scope="scope">
        <span>{{scope.row.name}}</span>
      </template>
    </el-table-column>
  </el-table>
</el-table-page>

API

element-table component attributes:

Attr. NameDescriptionRequiredTypeDefault Value
auto自动开始分页查询NBooleantrue
page分页值YObjectnew this.$page()
needPagination是否展示分页NBooleantrue
url表格加载路径NString''
options请求方法里传的参数NObject{}
method请求方法NString'get'
search表格搜索字段NFunctionfunction
processData数据格式处理NFunctionfunction
showClear是否展示清空筛选条件按钮NBooleantrue

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev


For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).