You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.3 KiB
Vue

<template>
<div>
<el-alert
effect="dark"
:closable="false"
title="基于 Element 的 Table 组件进行二次封装,实现数据驱动,支持所有 Table 参数 -- 带边框表格"
type="info"
style="margin-bottom: 20px;"
/>
<com-table
v-loading="loading"
:columns="columns"
:data="tableData"
border
/>
</div>
</template>
<script lang="ts">
import { defineComponent, ref } from 'vue'
const columns = [
{
key: 'date',
label: ''
},
{
key: 'name',
label: ''
},
{
key: 'address',
label: ''
}
]
const tableData = [
{
date: '2016-05-02',
name: '',
address: ' 1518 '
}, {
date: '2016-05-04',
name: '',
address: ' 1517 '
}, {
date: '2016-05-01',
name: '',
address: ' 1519 '
}, {
date: '2016-05-03',
name: '',
address: ' 1516 '
}
]
export default defineComponent({
// name: 'BorderTable',
setup() {
const loading = ref<boolean>(true)
setTimeout(() => {
loading.value = false
}, 1000)
return {
columns,
tableData,
loading
}
}
})
</script>
<style>
</style>