0.3.61 • Published 3 days ago

168wangxiao-ui v0.3.61

Weekly downloads
-
License
MIT
Repository
-
Last release
3 days ago

安装

npm install -S 168wangxiao-ui

引入

/** 引入 */
import WangxiaoUI from '168wangxiao-ui'

/** 挂载 */
Vue.use(WangxiaoUI);

columns:表头数据

必须:是

类型:Array

默认值: []

字段说明:prop:"对应 data 数据字段",label:"表头名称"

data:列表数据

必须:是

类型:Array

默认值:[]

showPagination:是否显示分页

类型:Boolean

默认值:true

可选值:true | false

frontendPaging:前端分页

类型:Boolean

默认值:false

可选值:true | false

pagination:前端分页

​ 类型:Object

​ 默认值:false

​ 可选值:true | false

:::tip 演示

    <package-table :frontendPaging="true" :data="dataata" :columns="columns">
    </package-table>

:::

BackendPaging:后端分页

类型:Boolean

默认值:false

可选值:true | false

分页参数:endPage

类型:Object

默认值:{

​ currentPage: 1,

​ pageSize: 10,

​ total: 0

​ }

headerCellStyle:表头单元格样式配置

可选值:Function | Object

默认值:

 {
 'background-color': '#f5f6f7',
 'font-size': '12px',
 'padding': '10px',
}

cellStyle:表格单元格的样式配置

可选值:Function | Object

默认值:

{
 'font-size': '12px',
 'padding': '10px'
}

paging:自定义分页

:::tip 例如

<package-table :data="data" :columns="columns">
	<template #paging="tempPagination">
    	分页
    </template>
</package-table>

:::

完整案例

<template>
	<package-table 
        :data="gridData" 
	    :columns="columns" 
	    @size-change="endSizeChange" 
	    @current-change="endCurrentChange" >
    </package-table>
</template>
<script>
export default {
  data(){
      return {
          gridData: [{
            name: "杨胜军",
            age: 18
          }],
          columns: [
              {
                prop: 'selection',
                type: 'selection',
                width: 80
    		 },{
                prop: "name",
                label: "姓名",
                width: 200,
        	   sortable: true, 
       	  	 },
            ],
      }
  },
  methods: {
    endSizeChange(val){
          console.log(val);
        },
        endCurrentChange(val){
          console.log(val);
        }
    }
}
</script>

组件传参

  props: {
    columns: {
      type: Array,
      default: () => []
    },
    data: {
      type: Array,
      default: () => []
    },
    headerCellStyle: {
      type: Function || Object,
      default: () => {
        return {
          'background-color': '#f5f6f7',
          'font-size': '12px',
          'padding': '10px',
        }
      }
    },
    cellStyle: {
      type: Function || Object,
      default: () => {
        return {
          'font-size': '12px',
          'padding': '10px'
        }
      }
    },
    /** 是否显示分页 */
    showPagination: {
      type: Boolean,
      default: true,
    },
    /** 前端分页 */
    frontendPaging: {
      type: Boolean,
      default: false,
    },
    /** 前端分页参数 */
    FrontPage: {
      type: Object,
      default: () => ({})
    },

    /** 后端分页 */
    BackendPaging: {
      type: Boolean,
      default: true,
    },
    /** 后端分页参数 */
    endPage: {
      type: Object,
      default: () => {
        return {
          currentPage: 1,
          pageSize: 10,
          total: 0
        }
      }
    },
    pageSizes: {
      default() {
        return [10, 20, 30, 50, 100];
      },
      type: Array
    },
    layout: {
      default() {
        return 'total, sizes, prev, pager, next, jumper';
      },
      type: String
    },
  },
0.3.61

3 days ago

0.3.60

15 days ago

0.3.59

21 days ago

0.3.58

22 days ago

0.3.57

22 days ago

0.3.56

22 days ago

0.3.55

28 days ago

0.3.54

1 month ago

0.3.53

2 months ago

0.3.52

2 months ago

0.3.51

2 months ago

0.3.50

2 months ago

0.3.49

2 months ago

0.3.48

3 months ago

0.3.47

3 months ago

0.3.46

3 months ago

0.3.45

4 months ago

0.3.44

4 months ago

0.3.43

4 months ago

0.3.42

4 months ago

0.3.39

6 months ago

0.3.38

6 months ago

0.3.37

6 months ago

0.3.41

6 months ago

0.3.40

6 months ago

0.3.31

7 months ago

0.3.30

7 months ago

0.3.36

6 months ago

0.3.35

6 months ago

0.3.34

7 months ago

0.3.33

7 months ago

0.3.32

7 months ago

0.3.29

7 months ago

0.3.28

7 months ago

0.3.27

7 months ago

0.3.26

7 months ago

0.3.9

9 months ago

0.3.17

8 months ago

0.3.16

8 months ago

0.3.15

8 months ago

0.3.14

8 months ago

0.3.13

8 months ago

0.3.12

8 months ago

0.3.11

8 months ago

0.3.10

9 months ago

0.3.20

8 months ago

0.2.16

10 months ago

0.2.15

10 months ago

0.3.25

7 months ago

0.2.13

10 months ago

0.3.24

7 months ago

0.3.23

7 months ago

0.3.22

7 months ago

0.3.21

7 months ago

0.3.0

10 months ago

0.3.19

8 months ago

0.3.18

8 months ago

0.3.6

9 months ago

0.3.5

10 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.1.11

11 months ago

0.1.12

11 months ago

0.2.12

11 months ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago