1.0.3 • Published 2 years ago

dth-ui v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

dth-ui

云南大通汇web前端模板

Build Setup

# install dependencies
npm install

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

# build for production with minification
npm run build

API

For detailed explanation on how things work, consult the docs for vue-loader.

这里关于表格的属性和事件只列出新增和有别于iview的属性,其他的属性和事件都可以设置,参考iview table参考文档。 row-class-name不建议再另外设置了,不然会影响封装实现的一些样式;

Table Attributes

属性说明类型参数默认值
data表格的数据Array-[]
columns列配置,参照iview表格组件,索引列和多选无需配置Array-[]
total数据总数Number-0
type表格的类型 序号(index) 单选(Radio) 多选(Check)String-'index'
show-page是否显示分页Boolean-true
justifyContent分页显示位置 flex-start center flex-endString-center
show-elevator是否显示页码电梯,可以快速切换到某一页Boolean-false
pageSizeOpts分页每页大小切换配置Array-10, 20, 30, 40

Table Methods

方法名说明参数返回值
on-check-select多选获取选中的行数据-Array
on-Radio-select单选 多选获取选中的行数据Object-
on-db-select双击选中事件-(row, index)
on-change-page切换index 切换size-Object, {page, size}

使用slot自定义列

<dth-table
      type="Check"
      :columns="column"
      :data="data"
      @on-check-select="selectTable"
      @on-db-select="selectTableDb"
      @on-Radio-select="selectRadioTable"
      :showPage="true"
      :border="true"
      :total="20"
      justifyContent="flex-start"
      @on-change-page="onChangePage"
    >
    <template slot-scope="{data}"  slot="action">
                <Button type="primary" size="small" style="margin-right: 5px" @click="show(data.index)">View</Button>
                <Button type="error" size="small" @click="remove(data.index)">Delete</Button>
            </template>
            </dth-table>

列配置:

// slot的值为模板里的slot值
{
   title: '操作',
   align: 'center',
   slot: 'action'
},
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago