-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathListItem.vue
36 lines (33 loc) · 946 Bytes
/
ListItem.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
<template functional>
<GridLayout rows="60, auto, 40">
<Label row="0"
textAlignment="center"
:text="props.item.type + ' ' + props.index"/>
<!-- Content -->
<ContentView row="1">
<slot>
<Label textWrap :text="props.item.body" row="1" class="content"/>
</slot>
</ContentView>
<GridLayout columns="*, *" row="2">
<Button @tap="() => listeners.toggleLike()"
:text="props.item.liked ? ' Unlike' : ' Like'"
:color="props.item.liked ? 'blue' : 'black'"
col="0" row="1"/>
<Button text="Blah"
col="1" row="1"/>
</GridLayout>
</GridLayout>
</template>
<script>
export default {
functional: true,
props: {
item: {
type: Object,
required: true
},
index: Number
}
}
</script>