增加注释
Showing
3 changed files
with
0 additions
and
103 deletions
1 | /* | ||
2 | * FileName: lb-render.vue | ||
3 | * Remark: 自定义render | ||
4 | * Project: lb-element-table | ||
5 | * Author: 任超 | ||
6 | * File Created: Tuesday, 19th March 2019 10:15:30 am | ||
7 | * Last Modified: Tuesday, 19th March 2019 10:15:32 am | ||
8 | * Modified By: 任超 | ||
9 | */ | ||
10 | <script> | ||
11 | export default { | ||
12 | name: 'LbRender', | ||
13 | functional: true, | ||
14 | props: { | ||
15 | scope: Object, | ||
16 | render: Function | ||
17 | }, | ||
18 | render: (h, ctx) => { | ||
19 | return ctx.props.render ? ctx.props.render(h, ctx.props.scope) : '' | ||
20 | } | ||
21 | } | ||
22 | </script> |
src/components/DownLbTable/forced.js
deleted
100644 → 0
1 | export default { | ||
2 | selection: { | ||
3 | renderHeader: (h, { store }) => { | ||
4 | return ( | ||
5 | <el-checkbox | ||
6 | disabled={store.states.data && store.states.data.length === 0} | ||
7 | indeterminate={ | ||
8 | store.states.selection.length > 0 && !store.states.isAllSelected | ||
9 | } | ||
10 | nativeOn-click={store.toggleAllSelection} | ||
11 | value={store.states.isAllSelected} | ||
12 | /> | ||
13 | ) | ||
14 | }, | ||
15 | renderCell: (h, { row, column, store, $index }) => { | ||
16 | return ( | ||
17 | <el-checkbox | ||
18 | nativeOn-click={event => event.stopPropagation()} | ||
19 | value={store.isSelected(row)} | ||
20 | disabled={ | ||
21 | column.selectable | ||
22 | ? !column.selectable.call(null, row, $index) | ||
23 | : false | ||
24 | } | ||
25 | on-input={() => { | ||
26 | store.commit('rowSelectedChanged', row) | ||
27 | }} | ||
28 | /> | ||
29 | ) | ||
30 | }, | ||
31 | sortable: false, | ||
32 | resizable: false | ||
33 | }, | ||
34 | index: { | ||
35 | renderHeader: (h, scope) => { | ||
36 | return <span>{scope.column.label || '#'}</span> | ||
37 | }, | ||
38 | renderCell: (h, { $index, column }) => { | ||
39 | let i = $index + 1 | ||
40 | const index = column.index | ||
41 | |||
42 | if (typeof index === 'number') { | ||
43 | i = $index + index | ||
44 | } else if (typeof index === 'function') { | ||
45 | i = index($index) | ||
46 | } | ||
47 | |||
48 | return <div>{i}</div> | ||
49 | }, | ||
50 | sortable: false | ||
51 | }, | ||
52 | expand: { | ||
53 | renderHeader: (h, scope) => { | ||
54 | return <span>{scope.column.label || ''}</span> | ||
55 | }, | ||
56 | renderCell: (h, { row, store }, proxy) => { | ||
57 | const expanded = store.states.expandRows.indexOf(row) > -1 | ||
58 | return ( | ||
59 | <div | ||
60 | class={ | ||
61 | 'el-table__expand-icon ' + | ||
62 | (expanded ? 'el-table__expand-icon--expanded' : '') | ||
63 | } | ||
64 | on-click={e => proxy.handleExpandClick(row, e)} | ||
65 | > | ||
66 | <i class='el-icon el-icon-arrow-right' /> | ||
67 | </div> | ||
68 | ) | ||
69 | }, | ||
70 | sortable: false, | ||
71 | resizable: false, | ||
72 | className: 'el-table__expand-column' | ||
73 | } | ||
74 | } |
-
Please register or sign in to post a comment