@@ -25,8 +25,6 @@ function generateGrid (rowCount, columnCount) {
25
25
26
26
const gridData = generateGrid ( 1000 , 10 )
27
27
28
- const five = [ 0 , 1 , 2 , 3 , 4 ]
29
-
30
28
module . exports = {
31
29
template : '<div><h1>{{ Math.random() }}</h1><my-table></my-table></div>' ,
32
30
components : {
@@ -41,56 +39,21 @@ module.exports = {
41
39
components : {
42
40
row : {
43
41
props : [ 'row' ] ,
44
- // template: '<tr><th>{{ Math.random() }}</th><column v-for="item in row.items"></column></tr>',
45
- render ( h ) {
46
- return h ( 'tr' , [
47
- new TextNode ( 1 , [
48
- new TextNode ( 2 ) ,
49
- ...this . row . items . map ( item => h ( 'column' ) )
50
- ] )
51
- ] )
52
- } ,
42
+ template : '<tr><th>{{ Math.random() }}</th><column v-for="item in row.items"></column></tr>' ,
53
43
components : {
54
44
column : {
55
- render ( h ) {
56
- return h ( 'td' , { class : 'item' } , [
57
- new TextNode ( 4 ,
58
- five . map ( ( ) => new TextNode ( 5 ,
59
- five . map ( ( ) => new TextNode ( 6 , [ new TextNode ( 7 ) ] ) ) )
60
- )
61
- )
62
- ] )
63
- }
64
- // template: '<td class="item">' +
65
- // // 25 plain elements for each cell
66
- // '<ul class="yoyo">' +
67
- // '<li class="hihi" v-for="i in 5">' +
68
- // '<span v-for="i in 5">fsefs</span>' +
69
- // '</li>' +
70
- // '</ul>' +
71
- // '</td>'
45
+ template : '<td class="item">' +
46
+ // 25 plain elements for each cell
47
+ '<ul class="yoyo">' +
48
+ '<li class="hihi" v-for="i in 5">' +
49
+ '<span v-for="i in 5">fsefs</span>' +
50
+ '</li>' +
51
+ '</ul>' +
52
+ '</td>'
72
53
}
73
54
}
74
55
}
75
56
}
76
57
}
77
58
}
78
59
}
79
-
80
- const renderFns = [
81
- { open : ( ) => `<tr>` , close : `</tr>` } ,
82
- { open : ( ) => `<th>` , close : `</th>` } ,
83
- { open : ( ) => Math . random ( ) } ,
84
- { open : ( ) => `<td class="item">` , close : `</td>` } ,
85
- { open : ( ) => `<ul class="yoyo">` , close : `</ul>` } ,
86
- { open : ( ) => `<li class="hihi">` , close : `</li>` } ,
87
- { open : ( ) => `<span>` , close : `</span>` } ,
88
- { open : ( ) => `fsefs` }
89
- ]
90
-
91
- function TextNode ( id , children ) {
92
- this . isTextNode = true
93
- this . open = renderFns [ id ] . open
94
- this . close = renderFns [ id ] . close
95
- this . children = children
96
- }
0 commit comments