cell component

This commit is contained in:
cookfront
2017-02-13 17:21:46 +08:00
parent 18d5372ddb
commit 35ec796e61
3 changed files with 43 additions and 9 deletions

View File

@@ -1,19 +1,20 @@
<template>
<div class="o2-cell">
<a class="o2-cell" :href="url">
<div class="o2-cell-title">
<slot name="icon">
<i v-if="icon" class="o2-icon" :class="'o2-icon-' + icon"></i>
</slot>
<slot name="title">
<span class="o2-cell-text" v-text="title"></span>
</slot>
</div>
<div class="o2-cell-value">
<slot>
<span v-text="value"></span>
</slot>
<i class="o2-cell-arrow-right" v-if="isLink"></i>
</div>
<i class="o2-cell-arrow-right"></i>
</div>
</a>
</template>
<script>
@@ -22,7 +23,26 @@ export default {
props: {
icon: String,
title: String
title: String,
value: String,
url: String,
isLink: Boolean
}
};
</script>
<style>
@component-namespace o2 {
@component cell {
display: block;
@descendent title {
float: left;
}
@descendent value {
float: right;
}
}
}
</style>