update List
This commit is contained in:
parent
fb7f36f91b
commit
c501f03c9d
4 changed files with 155 additions and 26 deletions
|
@ -1,13 +1,36 @@
|
|||
<template>
|
||||
<li class="ivu-list-item">
|
||||
<li class="ivu-list-item" :class="classes">
|
||||
<slot></slot>
|
||||
<ul class="ivu-list-item-action" v-if="$slots.action">
|
||||
<slot name="action"></slot>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ListItem',
|
||||
inject: ['ListInstance'],
|
||||
props: {
|
||||
|
||||
},
|
||||
computed: {
|
||||
isFlexMode () {
|
||||
const extra = this.$slots.extra;
|
||||
const itemLayout = this.ListInstance.itemLayout;
|
||||
|
||||
if (itemLayout === 'vertical') {
|
||||
return !!extra;
|
||||
}
|
||||
|
||||
return !this.$slots.default;
|
||||
},
|
||||
classes () {
|
||||
return [
|
||||
{
|
||||
'ivu-list-item-no-flex': !this.isFlexMode
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="ivu-list-container">
|
||||
<ul class="ivu-list-items"><slot></slot></ul>
|
||||
</div>
|
||||
<Spin v-if="loading"><slot name="spin"></slot></Spin>
|
||||
<Spin v-if="loading" fix size="large"><slot name="spin"></slot></Spin>
|
||||
<div class="ivu-list-footer" v-if="footer || $slots.footer"><slot name="footer">{{ footer }}</slot></div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -15,6 +15,11 @@
|
|||
|
||||
export default {
|
||||
name: 'List',
|
||||
provide () {
|
||||
return {
|
||||
ListInstance: this
|
||||
};
|
||||
},
|
||||
props: {
|
||||
border: {
|
||||
type: Boolean,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue