This repository was archived by the owner on Apr 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathTable.vue
56 lines (53 loc) · 2.13 KB
/
Table.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<template>
<docs-content title='Table'>
<div slot='Overview' v-html='overviewContent'></div>
<div slot='Variants'>
<docs-code-block title='Default Table' :code='defaultCode'>
<ou-table :data='tableData'>
<ou-table-column prop='name'>Name</ou-table-column>
<ou-table-column prop='age'>Age</ou-table-column>
<ou-table-column prop='date'>Date</ou-table-column>
</ou-table>
</docs-code-block>
<docs-code-block title='Fixed Table' :code='fixedCode'>
<ou-table :data='tableData' type='fixed'>
<ou-table-column prop='name'>Name</ou-table-column>
<ou-table-column prop='age'>Age</ou-table-column>
<ou-table-column prop='date'>Date</ou-table-column>
</ou-table>
</docs-code-block>
</div>
<div slot='Implementation'>
<docs-table type='props' :data='tableProps' name='Table'/>
<docs-table type='props' :data='tableColumnProps' name='Table Column' />
</div>
</docs-content>
</template>
<script>
import overviewContent from '../markdown/table/overview.md';
import defaultCode from '../markdown/table/defaultCode.md';
import fixedCode from '../markdown/table/fixedCode.md';
export default {
data() {
return {
overviewContent,
defaultCode,
fixedCode,
tableData: [
{ name: 'Ed', age: '24', date: '1993-11-12' },
{ name: 'Jack', age: '30', date: '1987-12-10' },
{ name: 'Blues', age: '51', date: '1966-06-15' },
{ name: 'Kurt', age: '23', date: '1994-04-05' }
],
tableProps: [
{ name: 'type', type: 'String', required: 'false', acceptedValue: 'fixed', description: 'type of the table' },
{ name: 'data', type: 'Array', required: 'true', description: 'data of the table' },
{ name: 'defaultValue', type: 'String, Number', required: 'false', description: 'the default value when data of table item is empty' },
],
tableColumnProps: [
{ name: 'prop', type: 'String', required: 'true', description: 'the field name of the data for table' },
]
};
}
};
</script>