index.vue
1.04 KB
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
<template>
<div class="zui-cell" :class="classRender">
<div v-if="$slots.icon" class="zui-cell__left-icon">
<slot name="icon"></slot>
</div>
<div v-else-if="icon" class="zui-cell__left-icon"></div>
<div v-if="$slots.title" class="zui-cell__title">
<slot name="title"></slot>
</div>
<div v-else-if="title" class="zui-cell__title">{{ title }}</div>
<div v-if="$slots.default" class="zui-cell__value">
<slot></slot>
</div>
<div v-else-if="value" class="zui-cell__value">{{ value }}</div>
<div v-if="$slots.right" class="zui-cell__right-icon">
<slot name="right"></slot>
</div>
<div v-else-if="rightIcon" class="zui-cell__right-icon"></div>
</div>
</template>
<script>
export default {
name: 'Cell',
props: {
icon: String,
title: String,
value: String,
isLink: Boolean,
rightIcon: String,
},
computed: {
classRender: function() {
return {
'zui-cell--clickable': this.isLink
}
}
}
}
</script>
<style>
@import "./index.css";
</style>