mirror of
https://github.com/youzan/vant.git
synced 2025-10-15 15:40:52 +00:00
cell component
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user