Skip to content
This repository was archived by the owner on Oct 5, 2019. It is now read-only.

Commit 981a2da

Browse files
committed
f7-list: add before-list, list, after-list slots
Fixes #401
1 parent 2ce2646 commit 981a2da

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/components/list.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
const self = this;
5050
5151
const listChildren = [];
52-
const ulChildren = [];
52+
const ulChildren = self.$slots.list || [];
5353
5454
if (self.$slots.default) {
5555
for (let i = 0; i < self.$slots.default.length; i += 1) {
@@ -99,7 +99,18 @@
9999
},
100100
},
101101
[
102-
ulChildren.length > 0 ? [c('ul', {}, ulChildren), listChildren] : listChildren,
102+
ulChildren.length > 0 ?
103+
[
104+
self.$slots['before-list'],
105+
c('ul', {}, ulChildren),
106+
self.$slots['after-list'],
107+
listChildren,
108+
] :
109+
[
110+
self.$slots['before-list'],
111+
listChildren,
112+
self.$slots['after-list'],
113+
],
103114
]
104115
);
105116
return blockEl;

0 commit comments

Comments
 (0)