Files
mes-ui-d2/src/pages/demo/element/data-table/index.vue
liyang 4bb3422148 表格组件示例
Former-commit-id: dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly dd9ec5144e4c4668498c42327126c9cd2ff9590a [formerly 096c7586394466fcfa6aeef76f941c65b6c58cb3 [formerly 6ea50546558bb7a5f54d99d34301d3fbae8beea4]]]]]
Former-commit-id: 4909868f8dac1be92c76feda0bc3c4a51f8221ca
Former-commit-id: 7bcf816a13380e5e1823ef3d8a0050fa95842c73
Former-commit-id: cea58af19fb83f6e4f61a7cc95e999706784a7f2 [formerly 881c7fe80386e4bbd6bdd323eb873c98e7894941]
Former-commit-id: edf39aef375f7ecf4d07951f57b8a92baab4ee37
Former-commit-id: 829a819ac72421f791a5cf5a4d62b7a860e7648b
Former-commit-id: e3da2e3e4a6f41a5a712760729560efdcf551a3f
Former-commit-id: 57e8f1b908c2578a985798a6672a650b9dc53c0c
Former-commit-id: 9667afc9b61cdbc5c624a07ee92b4156d0470582
2018-07-22 18:35:37 +08:00

38 lines
886 B
Vue

<template>
<d2-container type="ghost">
<template slot="header">表格组件</template>
<div class="d2-mt d2-mr">
<el-card
v-for="(table, index) in tableList"
:key="index"
shadow="never"
class="d2-card d2-mb">
<template slot="header">{{table.title}}</template>
<component :is="table.component"/>
</el-card>
</div>
</d2-container>
</template>
<script>
const req = context => context.keys().map(context)
const tables = req(require.context('./components', true, /\.vue$/))
const components = {}
const tableList = []
tables.forEach((table, index) => {
components[`d2-demo-el-table-${index + 1}`] = table.default
tableList.push({
title: table.default.title,
component: `d2-demo-el-table-${index + 1}`
})
})
export default {
components,
data () {
return {
tableList
}
}
}
</script>