Former-commit-id: 4c6a0a1f72e1f512b919b934d8483ed430b54766 [formerly f1a4641c19751caddc88308bd8e29fb337f88982] [formerly 4c6a0a1f72e1f512b919b934d8483ed430b54766 [formerly f1a4641c19751caddc88308bd8e29fb337f88982] [formerly 4c6a0a1f72e1f512b919b934d8483ed430b54766 [formerly f1a4641c19751caddc88308bd8e29fb337f88982] [formerly f1a4641c19751caddc88308bd8e29fb337f88982 [formerly 065fde485c713b3ae79131d9da1234dfcbc73cc4 [formerly 470fef55bcb2073a14b6fcc998caabcb83a1097c]]]]] Former-commit-id: c239db922bd8bd06fb68041118a2d25a9c7b475d Former-commit-id: ac5808e62e6ac021da35462b59a04004d62db2dc Former-commit-id: 7890270a60f4db69526403a56cb2dd4feb662e27 [formerly 7b8dd27f1eb72f5e3748d8174fa69c801a73ce1a] Former-commit-id: 027ba79fa86ad1be42f14ef03afebde0cc6ed924 Former-commit-id: 0425a72d2e2b3536fb2ac74199ede23a1e4bea96 Former-commit-id: 96bdce03185ba3befec93d08016d63c7c3c2030a Former-commit-id: e988828be9b03917a9579651a2912d2ed840fb7d Former-commit-id: 07646c36ed91ea4e1efac1bdf1b16b84d8d32eaa
42 lines
1006 B
Vue
42 lines
1006 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>
|
|
import { sortBy } from 'lodash'
|
|
const req = context => context.keys().map(context)
|
|
const tables = req(require.context('./components', true, /\.vue$/))
|
|
const components = {}
|
|
const tableList = []
|
|
sortBy(tables.map(e => ({
|
|
component: e.default,
|
|
index: e.default.index
|
|
})), ['index']).forEach((table, index) => {
|
|
components[`d2-demo-el-table-${index + 1}`] = table.component
|
|
tableList.push({
|
|
title: table.component.title,
|
|
component: `d2-demo-el-table-${index + 1}`
|
|
})
|
|
})
|
|
export default {
|
|
components,
|
|
data () {
|
|
return {
|
|
tableList
|
|
}
|
|
}
|
|
}
|
|
</script>
|