
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
element-table-plugin
Advanced tools
基于Element,根据配置为网页添加表格
// main.js
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import elementTable from 'element-table-plugin'
import App from './App.vue'
Vue.use(ElementUI)
Vue.use(elementTable, { // 详见fields
page: 'page',
pageSize: 'limit',
code: 'stat',
apiSuccess: 1,
data: 'data.list', // 取表格数据
total: 'data.total', // 取总条数
})
// or
// Vue.use(elementTable)
new Vue({
render: h => h(App),
}).$mount('#app')
// index.vue
<element-table
:initRequest="request"
:initColumns="columns"
:canChangeColumns="canChangeColumns"
:initPagination="pagination">
<template #action="{row}">
<span @click="edit(row)">编辑</span>
</template>
</element-table>
<script>
export default {
data () {
return {
request: {
url: '/api/data/list',
method: 'post',
},
columns: [
{
prop: 'name',
label: '姓名',
fixed: 'left',
width: '280px',
},
{
prop: 'desc',
label: '描述',
showOverflowPopover: true,
},
{
prop: 'create_time',
label: '创建时间',
sortable: true,
},
{
prop: 'action',
label: '操作',
}
],
canChangeColumns: true,
pagination: {
pageSize: 20,
},
}
},
methods: {
edit (row) {
//
},
},
}
</script>
请求表身,与axios中的一致,支持异步传入
类型:object
默认值:{}
字段集
类型:object
默认值:{}
属性的列表:
| 参数 | 说明 | 类型 | required | 默认值 |
|---|---|---|---|---|
| page | 当前页 | string | false | - |
| pageSize | 每页条数 | string | false | - |
| code | 状态码 | string | false | - |
| apiSuccess | 成功的状态码的值 | number | false | - |
| data | 表身 | string | false | - |
| total | 总条目数 | string | false | - |
表头
类型:Array<object>
默认值:[]
元素的属性的列表:
| 参数 | 说明 | 类型 | required | 默认值 |
|---|---|---|---|---|
| prop | 列的prop,与Element中的一致 | string | true | - |
| label | 列的label,与Element中的一致 | string | false | - |
| align | 对齐方式,与Element中的一致 | string | false | - |
| width | 列的宽,与Element中的一致 | string | false | - |
| showOverflowPopover | 是否用浮层显示单元格的详情 | boolean | false | - |
| fixed | 固定列,与Element中的一致 | string | boolean | false | - |
| sortable | 是否支持排序 | boolean | false | - |
表身,配了initRequest就不用传这个
类型:Array<object>
默认值:[]
分页
类型:object
属性的列表:
| 参数 | 说明 | 类型 | required | 默认值 |
|---|---|---|---|---|
| page | 当前页 | number | false | 1 |
| pageSize | 每页条数 | number | false | 30 |
| total | 总条目数 | number | false | 0 |
| 方法名 | 说明 |
|---|---|
| getFields | 返回表头和表身的数据 |
| name | 说明 |
|---|---|
| 列的prop | 自定义列的内容,参数为 { row } |
FAQs
基于Element,根据配置为网页添加表格
We found that element-table-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.